diff options
author | Dan Williams <dcbw@redhat.com> | 2014-01-08 12:24:36 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-01-23 17:34:12 -0600 |
commit | 1878a5e4c99291c385337347dc496609c865d004 (patch) | |
tree | d5f4fa5f962857cf2bb30f023c1cf128f472b744 /libnm-glib/nm-client.c | |
parent | 41d735b9a129e88b22c510589e73fcf317c664e0 (diff) |
libnm-glib: convert NMClient Devices to a real property
Diffstat (limited to 'libnm-glib/nm-client.c')
-rw-r--r-- | libnm-glib/nm-client.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 68ad41245..f1f6916b6 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -100,6 +100,7 @@ enum { PROP_CONNECTIVITY, PROP_PRIMARY_CONNECTION, PROP_ACTIVATING_CONNECTION, + PROP_DEVICES, LAST_PROP }; @@ -120,9 +121,6 @@ static void proxy_name_owner_changed (DBusGProxy *proxy, const char *new_owner, gpointer user_data); -static void client_device_added (NMObject *client, NMObject *device); -static void client_device_removed (NMObject *client, NMObject *device); - /**********************************************************************/ /** @@ -195,20 +193,13 @@ register_properties (NMClient *client) { NM_CLIENT_CONNECTIVITY, &priv->connectivity }, { NM_CLIENT_PRIMARY_CONNECTION, &priv->primary_connection, NULL, NM_TYPE_ACTIVE_CONNECTION }, { NM_CLIENT_ACTIVATING_CONNECTION, &priv->activating_connection, NULL, NM_TYPE_ACTIVE_CONNECTION }, + { NM_CLIENT_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE, "device" }, { NULL }, }; _nm_object_register_properties (NM_OBJECT (client), priv->client_proxy, property_info); - - _nm_object_register_pseudo_property (NM_OBJECT (client), - priv->client_proxy, - "Devices", - &priv->devices, - NM_TYPE_DEVICE, - client_device_added, - client_device_removed); } #define NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK "org.freedesktop.NetworkManager.enable-disable-network" @@ -1402,18 +1393,6 @@ proxy_name_owner_changed (DBusGProxy *proxy, } } -static void -client_device_added (NMObject *client, NMObject *device) -{ - g_signal_emit (client, signals[DEVICE_ADDED], 0, device); -} - -static void -client_device_removed (NMObject *client, NMObject *device) -{ - g_signal_emit (client, signals[DEVICE_REMOVED], 0, device); -} - /** * nm_client_get_connectivity: * @client: an #NMClient @@ -2161,6 +2140,9 @@ get_property (GObject *object, case PROP_ACTIVATING_CONNECTION: g_value_set_object (value, priv->activating_connection); break; + case PROP_DEVICES: + g_value_set_boxed (value, nm_client_get_devices (self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2389,6 +2371,21 @@ nm_client_class_init (NMClientClass *client_class) NM_TYPE_ACTIVE_CONNECTION, G_PARAM_READABLE)); + /** + * NMClient:devices: + * + * List of known network devices. + * + * Since: 0.9.10 + **/ + g_object_class_install_property + (object_class, PROP_DEVICES, + g_param_spec_boxed (NM_CLIENT_DEVICES, + "Devices", + "Devices", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE)); + /* signals */ /** |