From e80a0863cbb03678e16b82cb9d87296b763bb870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20K=C3=A4stner?= Date: Sun, 31 Mar 2024 20:30:11 +0200 Subject: [PATCH] network: fix crash when adding cellular connection 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 2e32c6ea..da6323de 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" @@ -474,6 +475,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,