File gnome-control-center-fix-mobile-network-list.patch of Package gnome-control-center.10840

From c0d5e52cacdcfff411c2d2001af0c04aea123a41 Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathan121537@gmail.com>
Date: Thu, 13 Oct 2016 14:57:11 +0800
Subject: [PATCH] network: Fix broken mobile netowrk combobox

The combobox in mobile broadband page does not show created networks.
---
 panels/network/net-device-mobile.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c
index 55c5abb..4a79f73 100644
--- a/panels/network/net-device-mobile.c
+++ b/panels/network/net-device-mobile.c
@@ -202,17 +202,23 @@ device_add_device_connections (NetDeviceMobile *device_mobile,
                                GtkComboBox *combobox)
 {
         NetDeviceMobilePrivate *priv = device_mobile->priv;
-        GSList *list, *l;
+        const GPtrArray *conn_list;
+        gint conn_count;
+        gint i;
         GtkTreeIter treeiter;
         NMActiveConnection *active_connection;
         NMConnection *connection;
 
-        /* get the list of available connections for this device */
-        list = net_device_get_valid_connections (NET_DEVICE (device_mobile));
+        conn_list = nm_device_get_available_connections (nm_device);
         gtk_list_store_clear (liststore);
         active_connection = nm_device_get_active_connection (nm_device);
-        for (l = list; l; l = g_slist_next (l)) {
-                connection = NM_CONNECTION (l->data);
+        if (conn_list == NULL)
+                conn_count = 0;
+        else
+                conn_count = conn_list->len;
+
+        for (i = 0; i < conn_count; i++) {
+                connection = NM_CONNECTION (conn_list->pdata[i]);
                 gtk_list_store_append (liststore, &treeiter);
                 gtk_list_store_set (liststore,
                                     &treeiter,
@@ -237,8 +243,6 @@ device_add_device_connections (NetDeviceMobile *device_mobile,
                             COLUMN_ID, NULL,
                             COLUMN_TITLE, _("Add new connection"),
                             -1);
-
-        g_slist_free (list);
 }
 
 static void
-- 
2.7.4