From 4d9be8916625390d58dd624808ea599fa173db32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20K=C3=A4stner?= Date: Tue, 14 May 2024 18:41:26 +0200 Subject: [PATCH] network: fix crash when adding cellular connection (#329) As GTK is loaded first, while libNMA is loaded later with the network panel extension, the GtkBuilder for the wizard GUI doesn't know the libNMA types. To fix that, we need to ensure the registration of these types. Fixes: #225, #246 --- panels/network/network-dialogs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panels/network/network-dialogs.c b/panels/network/network-dialogs.c index a46ba8b..78bcbcd 100644 --- a/panels/network/network-dialogs.c +++ b/panels/network/network-dialogs.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "network-dialogs.h" @@ -472,6 +473,10 @@ cc_network_panel_connect_to_3g_network (GtkWidget *toplevel, closure->client = g_object_ref (client); closure->device = g_object_ref (device); + g_type_ensure (NMA_TYPE_COUNTRY_INFO); + g_type_ensure (NMA_TYPE_MOBILE_ACCESS_METHOD); + g_type_ensure (NMA_TYPE_MOBILE_PROVIDER); + caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device)); if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) { wizard = nma_mobile_wizard_new (GTK_WINDOW (toplevel), NULL, NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS, FALSE,