core: use defines for signal names

This commit is contained in:
Thomas Haller 2016-09-12 12:29:34 +02:00
parent b519b96c4e
commit 042f2b2e7e
5 changed files with 17 additions and 9 deletions

View file

@ -12921,7 +12921,7 @@ nm_device_class_init (NMDeviceClass *klass)
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
signals[AUTOCONNECT_ALLOWED] =
g_signal_new ("autoconnect-allowed",
g_signal_new (NM_DEVICE_AUTOCONNECT_ALLOWED,
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
0,

View file

@ -87,6 +87,7 @@
#define NM_DEVICE_RECHECK_ASSUME "recheck-assume"
#define NM_DEVICE_STATE_CHANGED "state-changed"
#define NM_DEVICE_LINK_INITIALIZED "link-initialized"
#define NM_DEVICE_AUTOCONNECT_ALLOWED "autoconnect-allowed"
#define NM_DEVICE_STATISTICS_REFRESH_RATE_MS "refresh-rate-ms"
#define NM_DEVICE_STATISTICS_TX_BYTES "tx-bytes"

View file

@ -178,7 +178,7 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
/* wait with continuing configuration untill the companion device is done scanning */
g_object_get (priv->companion, "scanning", &scanning, NULL);
g_object_get (priv->companion, NM_DEVICE_WIFI_SCANNING, &scanning, NULL);
if (scanning) {
priv->stage1_waiting = TRUE;
return NM_ACT_STAGE_RETURN_POSTPONE;
@ -267,7 +267,7 @@ companion_notify_cb (NMDeviceWifi *companion, GParamSpec *pspec, gpointer user_d
if (!priv->stage1_waiting)
return;
g_object_get (companion, "scanning", &scanning, NULL);
g_object_get (companion, NM_DEVICE_WIFI_SCANNING, &scanning, NULL);
if (!scanning) {
priv->stage1_waiting = FALSE;
@ -343,13 +343,13 @@ check_companion (NMDeviceOlpcMesh *self, NMDevice *other)
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",
g_signal_connect (G_OBJECT (other), "notify::" NM_DEVICE_WIFI_SCANNING,
G_CALLBACK (companion_notify_cb), self);
g_signal_connect (G_OBJECT (other), "scanning-allowed",
g_signal_connect (G_OBJECT (other), NM_DEVICE_WIFI_SCANNING_ALLOWED,
G_CALLBACK (companion_scan_allowed_cb), self);
g_signal_connect (G_OBJECT (other), "autoconnect-allowed",
g_signal_connect (G_OBJECT (other), NM_DEVICE_AUTOCONNECT_ALLOWED,
G_CALLBACK (companion_autoconnect_allowed_cb), self);
g_object_notify (G_OBJECT (self), NM_DEVICE_OLPC_MESH_COMPANION);

View file

@ -3199,7 +3199,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
/* Signals */
signals[ACCESS_POINT_ADDED] =
g_signal_new ("access-point-added",
g_signal_new (NM_DEVICE_WIFI_ACCESS_POINT_ADDED,
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
0,
@ -3208,7 +3208,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
NM_TYPE_AP);
signals[ACCESS_POINT_REMOVED] =
g_signal_new ("access-point-removed",
g_signal_new (NM_DEVICE_WIFI_ACCESS_POINT_REMOVED,
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
0,
@ -3217,7 +3217,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
NM_TYPE_AP);
signals[SCANNING_ALLOWED] =
g_signal_new ("scanning-allowed",
g_signal_new (NM_DEVICE_WIFI_SCANNING_ALLOWED,
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NMDeviceWifiClass, scanning_allowed),

View file

@ -39,6 +39,13 @@
#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities"
#define NM_DEVICE_WIFI_SCANNING "scanning"
/* signals */
#define NM_DEVICE_WIFI_ACCESS_POINT_ADDED "access-point-added"
#define NM_DEVICE_WIFI_ACCESS_POINT_REMOVED "access-point-removed"
/* internal signals */
#define NM_DEVICE_WIFI_SCANNING_ALLOWED "scanning-allowed"
typedef struct _NMDeviceWifi NMDeviceWifi;
typedef struct _NMDeviceWifiClass NMDeviceWifiClass;