summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoaquim Rocha <jrocha@endlessm.com>2018-08-17 00:05:11 +0200
committerJoaquim Rocha <jrocha@endlessm.com>2018-08-28 17:32:01 +0200
commit7a97ebd5aed232e2694cc7e9f2ce058b5ef0a303 (patch)
tree39ba6c406bca0af23f5f26aabbaf440e8b8eca2c
parent7eb224706ee25fbc4f036badacde59dd8be2a41c (diff)
downloadgnome-initial-setup-7a97ebd5aed232e2694cc7e9f2ce058b5ef0a303.tar.gz
network: Do not refresh Wi-Fi list when not needed
The Wi-Fi list should be refreshed: 1) periodically, 2) every time the Wi-Fi device changes state (i.e. when connecting to a network, when obtaining an IP, and when a connection has been activated). So this adds the call for refreshing the list when the device state changes, and removes it from a number of places where it is just not needed.
-rw-r--r--gnome-initial-setup/pages/network/gis-network-page.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gnome-initial-setup/pages/network/gis-network-page.c b/gnome-initial-setup/pages/network/gis-network-page.c
index 78b6a53..00d3a72 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.c
+++ b/gnome-initial-setup/pages/network/gis-network-page.c
@@ -443,7 +443,6 @@ connection_activate_cb (GObject *object,
gpointer user_data)
{
NMClient *client = NM_CLIENT (object);
- GisNetworkPage *page = GIS_NETWORK_PAGE (user_data);
NMActiveConnection *connection;
GError *error = NULL;
@@ -454,7 +453,6 @@ connection_activate_cb (GObject *object,
/* failed to activate */
g_warning ("Failed to activate a connection: %s", error->message);
g_error_free (error);
- refresh_wireless_list (page);
}
}
@@ -464,7 +462,6 @@ connection_add_activate_cb (GObject *object,
gpointer user_data)
{
NMClient *client = NM_CLIENT (object);
- GisNetworkPage *page = GIS_NETWORK_PAGE (user_data);
NMActiveConnection *connection;
GError *error = NULL;
@@ -475,7 +472,6 @@ connection_add_activate_cb (GObject *object,
/* failed to activate */
g_warning ("Failed to add and activate a connection: %s", error->message);
g_error_free (error);
- refresh_wireless_list (page);
}
}
@@ -545,7 +541,7 @@ row_activated (GtkListBox *box,
priv->nm_device, NULL,
NULL,
connection_activate_cb, page);
- goto out;
+ return;
}
nm_client_add_and_activate_connection_async (priv->nm_client,
@@ -581,8 +577,6 @@ active_connections_changed (NMClient *client, GParamSpec *pspec, GisNetworkPage
g_object_set_data (G_OBJECT (connection), "has-state-changed-handler", GINT_TO_POINTER (1));
}
}
-
- refresh_wireless_list (page);
}
static void
@@ -593,6 +587,7 @@ sync_complete (GisNetworkPage *page)
activated = (nm_device_get_state (priv->nm_device) == NM_DEVICE_STATE_ACTIVATED);
gis_page_set_complete (GIS_PAGE (page), activated);
+ refresh_wireless_list (page);
}
static void
@@ -670,7 +665,6 @@ gis_network_page_constructed (GObject *object)
g_signal_connect (priv->network_list, "row-activated",
G_CALLBACK (row_activated), page);
- refresh_wireless_list (page);
sync_complete (page);
gis_page_set_skippable (GIS_PAGE (page), TRUE);