diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-17 12:40:41 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-17 14:25:25 +0200 |
commit | 0010e9325110e5a70a0d2381c84f88e7fb044ce4 (patch) | |
tree | ffd6d04397da8d8dea883b43a95e21e5d5a4ad2b /libupower-glib | |
parent | 8453da5014e6750ff2cdffcaa3a89dd616ca7434 (diff) | |
download | upower-0010e9325110e5a70a0d2381c84f88e7fb044ce4.tar.gz |
all: Remove *changed signals
Now that we send out PropertiesChanged signals (on the daemon side)
and "notify" signals (on the client side), there's no need for the
all encompassing DeviceChanged and Changed signals.
They would have woken up any client, even if they were not interested
in receiving the signals.
Diffstat (limited to 'libupower-glib')
-rw-r--r-- | libupower-glib/up-client.c | 59 | ||||
-rw-r--r-- | libupower-glib/up-client.h | 3 | ||||
-rw-r--r-- | libupower-glib/up-device.c | 24 | ||||
-rw-r--r-- | libupower-glib/up-device.h | 2 |
4 files changed, 0 insertions, 88 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c index 025455a..8ff81a5 100644 --- a/libupower-glib/up-client.c +++ b/libupower-glib/up-client.c @@ -59,9 +59,7 @@ struct _UpClientPrivate enum { UP_CLIENT_DEVICE_ADDED, - UP_CLIENT_DEVICE_CHANGED, UP_CLIENT_DEVICE_REMOVED, - UP_CLIENT_CHANGED, UP_CLIENT_LAST_SIGNAL }; @@ -308,18 +306,6 @@ up_device_added_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *cli } /* - * up_client_changed_cb: - */ -static void -up_device_changed_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *client) -{ - UpDevice *device; - device = up_client_get_device (client, object_path); - if (device != NULL) - g_signal_emit (client, signals [UP_CLIENT_DEVICE_CHANGED], 0, device); -} - -/* * up_client_removed_cb: */ static void @@ -333,15 +319,6 @@ up_device_removed_cb (UpClientGlue *proxy, const gchar *object_path, UpClient *c } } -/* - * up_client_changed_cb: - */ -static void -up_client_changed_cb (UpClientGlue *proxy, UpClient *client) -{ - g_signal_emit (client, signals [UP_CLIENT_CHANGED], 0); -} - static void up_client_get_property (GObject *object, guint prop_id, @@ -489,37 +466,6 @@ up_client_class_init (UpClientClass *klass) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, UP_TYPE_DEVICE); - /** - * UpClient::device-changed: - * @client: the #UpClient instance that emitted the signal - * @device: the #UpDevice that was changed. - * - * The ::device-changed signal is emitted when a power device is changed. - * - * Since: 0.9.0 - **/ - signals [UP_CLIENT_DEVICE_CHANGED] = - g_signal_new ("device-changed", - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (UpClientClass, device_changed), - NULL, NULL, g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, UP_TYPE_DEVICE); - - /** - * UpClient::changed: - * @client: the #UpClient instance that emitted the signal - * - * The ::changed signal is emitted when properties may have changed. - * - * Since: 0.9.0 - **/ - signals [UP_CLIENT_CHANGED] = - g_signal_new ("changed", - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (UpClientClass, changed), - NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - g_type_class_add_private (klass, sizeof (UpClientPrivate)); } @@ -595,11 +541,6 @@ up_client_init (UpClient *client) G_CALLBACK (up_device_added_cb), client); g_signal_connect (client->priv->proxy, "device-removed", G_CALLBACK (up_device_removed_cb), client); - g_signal_connect (client->priv->proxy, "device-changed", - G_CALLBACK (up_device_changed_cb), client); - g_signal_connect (client->priv->proxy, "changed", - G_CALLBACK (up_client_changed_cb), client); - g_signal_connect (client->priv->proxy, "notify", G_CALLBACK (up_client_notify_cb), client); } diff --git a/libupower-glib/up-client.h b/libupower-glib/up-client.h index 151f29b..935a651 100644 --- a/libupower-glib/up-client.h +++ b/libupower-glib/up-client.h @@ -55,11 +55,8 @@ typedef struct GObjectClass parent_class; void (*device_added) (UpClient *client, UpDevice *device); - void (*device_changed) (UpClient *client, - UpDevice *device); void (*device_removed) (UpClient *client, UpDevice *device); - void (*changed) (UpClient *client); /*< private >*/ /* Padding for future expansion */ void (*_up_client_reserved1) (void); diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c index 59430cc..85f90c8 100644 --- a/libupower-glib/up-device.c +++ b/libupower-glib/up-device.c @@ -94,13 +94,6 @@ enum { PROP_LAST }; -enum { - SIGNAL_CHANGED, - SIGNAL_LAST -}; - -static guint signals [SIGNAL_LAST] = { 0 }; - G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT) /* @@ -109,8 +102,6 @@ G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT) static void up_device_changed_cb (UpDeviceGlue *proxy, GParamSpec *pspec, UpDevice *device) { - g_return_if_fail (UP_IS_DEVICE (device)); - g_signal_emit (device, signals [SIGNAL_CHANGED], 0); g_object_notify (device, pspec->name); } @@ -791,21 +782,6 @@ up_device_class_init (UpDeviceClass *klass) object_class->get_property = up_device_get_property; /** - * UpDevice::changed: - * @device: the #UpDevice instance that emitted the signal - * - * The ::changed signal is emitted when the device data has changed. - * - * Since: 0.9.0 - **/ - signals [SIGNAL_CHANGED] = - g_signal_new ("changed", - G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (UpDeviceClass, changed), - NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - /** * UpDevice:update-time: * * The last time the device was updated. diff --git a/libupower-glib/up-device.h b/libupower-glib/up-device.h index 231bcb2..5186796 100644 --- a/libupower-glib/up-device.h +++ b/libupower-glib/up-device.h @@ -53,8 +53,6 @@ typedef struct typedef struct { GObjectClass parent_class; - void (*changed) (UpDevice *device, - gpointer *obj); /*< private >*/ /* Padding for future expansion */ void (*_up_device_reserved1) (void); |