summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-12-07 19:42:59 +0100
committerThomas Haller <thaller@redhat.com>2015-12-07 19:53:14 +0100
commitee4ec4e60004f024e2dd82d54d39daeb64fb918c (patch)
treea27e8dfff63b12a2899930567aa71811a93902fb
parent04c70c76bccf86a5870d957c35d4cff69ae5e558 (diff)
downloadNetworkManager-ee4ec4e60004f024e2dd82d54d39daeb64fb918c.tar.gz
core: use define for NMDevice's "state-changed" signal name
-rw-r--r--src/devices/nm-device-vlan.c2
-rw-r--r--src/devices/nm-device.c7
-rw-r--r--src/devices/nm-device.h1
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c2
-rw-r--r--src/nm-active-connection.c2
-rw-r--r--src/nm-manager.c2
-rw-r--r--src/nm-policy.c2
7 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c
index 3cd7d9c6ac..7861cf2b4d 100644
--- a/src/devices/nm-device-vlan.c
+++ b/src/devices/nm-device-vlan.c
@@ -126,7 +126,7 @@ nm_device_vlan_set_parent (NMDeviceVlan *self, NMDevice *parent)
if (parent) {
priv->parent = g_object_ref (parent);
priv->parent_state_id = g_signal_connect (priv->parent,
- "state-changed",
+ NM_DEVICE_STATE_CHANGED,
G_CALLBACK (parent_state_changed),
device);
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 3d4fb7b041..dc23805f06 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2191,7 +2191,8 @@ nm_device_master_add_slave (NMDevice *self, NMDevice *slave, gboolean configure)
info = g_slice_new0 (SlaveInfo);
info->slave = g_object_ref (slave);
info->configure = configure;
- info->watch_id = g_signal_connect (slave, "state-changed",
+ info->watch_id = g_signal_connect (slave,
+ NM_DEVICE_STATE_CHANGED,
G_CALLBACK (slave_state_changed), self);
priv->slaves = g_slist_append (priv->slaves, info);
slave_priv->master = g_object_ref (self);
@@ -9543,7 +9544,7 @@ _set_state_full (NMDevice *self,
g_object_notify (G_OBJECT (self), NM_DEVICE_STATE);
g_object_notify (G_OBJECT (self), NM_DEVICE_STATE_REASON);
- g_signal_emit_by_name (self, "state-changed", state, old_state, reason);
+ g_signal_emit_by_name (self, NM_DEVICE_STATE_CHANGED, state, old_state, reason);
/* Post-process the event after internal notification */
@@ -10778,7 +10779,7 @@ nm_device_class_init (NMDeviceClass *klass)
/* Signals */
signals[STATE_CHANGED] =
- g_signal_new ("state-changed",
+ g_signal_new (NM_DEVICE_STATE_CHANGED,
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NMDeviceClass, state_changed),
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index 45c7306459..6f9e0462e0 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -80,6 +80,7 @@
#define NM_DEVICE_REMOVED "removed"
#define NM_DEVICE_RECHECK_AUTO_ACTIVATE "recheck-auto-activate"
#define NM_DEVICE_RECHECK_ASSUME "recheck-assume"
+#define NM_DEVICE_STATE_CHANGED "state-changed"
#define NM_DEVICE_LINK_INITIALIZED "link-initialized"
G_BEGIN_DECLS
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index 8898c59cd6..585c7022ad 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -339,7 +339,7 @@ check_companion (NMDeviceOlpcMesh *self, NMDevice *other)
_LOGI (LOGD_OLPC, "found companion WiFi device %s",
nm_device_get_iface (other));
- g_signal_connect (G_OBJECT (other), "state-changed",
+ g_signal_connect (G_OBJECT (other), NM_DEVICE_STATE_CHANGED,
G_CALLBACK (companion_state_changed_cb), self);
g_signal_connect (G_OBJECT (other), "notify::scanning",
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 604e6ec4ec..4495b4252d 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -504,7 +504,7 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device)
priv->device = g_object_ref (device);
- g_signal_connect (device, "state-changed",
+ g_signal_connect (device, NM_DEVICE_STATE_CHANGED,
G_CALLBACK (device_state_changed), self);
g_signal_connect (device, "notify::master",
G_CALLBACK (device_master_changed), self);
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 1b37876a38..d2a78f00d5 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1788,7 +1788,7 @@ add_device (NMManager *self, NMDevice *device)
priv->devices = g_slist_append (priv->devices, g_object_ref (device));
- g_signal_connect (device, "state-changed",
+ g_signal_connect (device, NM_DEVICE_STATE_CHANGED,
G_CALLBACK (manager_device_state_changed),
self);
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 0fc761642d..9362d109d9 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -1370,7 +1370,7 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data)
NMPolicy *policy = (NMPolicy *) user_data;
/* Connect state-changed with _after, so that the handler is invoked after other handlers. */
- _connect_device_signal (policy, device, "state-changed", device_state_changed, TRUE);
+ _connect_device_signal (policy, device, NM_DEVICE_STATE_CHANGED, device_state_changed, TRUE);
_connect_device_signal (policy, device, NM_DEVICE_IP4_CONFIG_CHANGED, device_ip4_config_changed, FALSE);
_connect_device_signal (policy, device, NM_DEVICE_IP6_CONFIG_CHANGED, device_ip6_config_changed, FALSE);
_connect_device_signal (policy, device, "notify::" NM_DEVICE_AUTOCONNECT, device_autoconnect_changed, FALSE);