[network-manager-applet/nm-1-4] applet: subscribe to notify::state property of unsupported devices
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nm-1-4] applet: subscribe to notify::state property of unsupported devices
- Date: Thu, 20 Apr 2017 16:47:02 +0000 (UTC)
commit 860b9d711d3d54a839efe1e2db0cc28e97a5f04d
Author: Beniamino Galvani <bgalvani redhat com>
Date: Wed Apr 19 13:52:15 2017 +0200
applet: subscribe to notify::state property of unsupported devices
In different places we call applet_is_any_device_activating() to start
or stop an activation animation. Such fuction takes all devices into
account, including ones not directly supported by the
applet. Therefore, we should update the animation status also when
their state changes.
Without this commit, the applet starts the icon animation when an
unsupported device is activating but does not stop it when the device
changes state.
https://bugzilla.redhat.com/show_bug.cgi?id=1442782
(cherry picked from commit 2dad2bfecf003c7af1ae2eb9529c87d53d97ad2e)
src/applet.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 31e2f44..bae5a6d 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -2149,13 +2149,14 @@ foo_device_state_changed_cb (NMDevice *device,
NMADeviceClass *dclass;
dclass = get_device_class (device, applet);
- g_assert (dclass);
- if (dclass->device_state_changed)
+ if (dclass && dclass->device_state_changed)
dclass->device_state_changed (device, new_state, old_state, reason, applet);
+
applet_common_device_state_changed (device, new_state, old_state, reason, applet);
- if ( new_state == NM_DEVICE_STATE_ACTIVATED
+ if ( dclass
+ && new_state == NM_DEVICE_STATE_ACTIVATED
&& !g_settings_get_boolean (applet->gsettings, PREF_DISABLE_CONNECTED_NOTIFICATIONS)) {
NMConnection *connection;
char *str = NULL;
@@ -2181,15 +2182,12 @@ foo_device_added_cb (NMClient *client, NMDevice *device, gpointer user_data)
NMADeviceClass *dclass;
dclass = get_device_class (device, applet);
- if (!dclass)
- return;
-
- if (dclass->device_added)
+ if (dclass && dclass->device_added)
dclass->device_added (device, applet);
g_signal_connect (device, "state-changed",
- G_CALLBACK (foo_device_state_changed_cb),
- user_data);
+ G_CALLBACK (foo_device_state_changed_cb),
+ user_data);
foo_device_state_changed_cb (device,
nm_device_get_state (device),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]