diff options
-rw-r--r-- | libupower-glib/up-client.c | 7 | ||||
-rw-r--r-- | libupower-glib/up-device.c | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c index 330c0ad..d92a407 100644 --- a/libupower-glib/up-client.c +++ b/libupower-glib/up-client.c @@ -274,7 +274,12 @@ up_client_notify_cb (GObject *gobject, UpClient *client) { /* Proxy the notification from the D-Bus glue object - * to the real one */ + * to the real one, but only if the property exists + * for UpClient */ + if (!g_object_class_find_property (G_OBJECT_GET_CLASS (client), + pspec->name)) + return; + g_object_notify (G_OBJECT (client), pspec->name); } diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c index 4015039..f90b862 100644 --- a/libupower-glib/up-device.c +++ b/libupower-glib/up-device.c @@ -103,6 +103,13 @@ G_DEFINE_TYPE (UpDevice, up_device, G_TYPE_OBJECT) static void up_device_changed_cb (UpExportedDevice *proxy, GParamSpec *pspec, UpDevice *device) { + /* Proxy the notification from the D-Bus glue object + * to the real one, but only if the property exists + * for UpClient */ + if (!g_object_class_find_property (G_OBJECT_GET_CLASS (device), pspec->name) && + !g_str_equal (pspec->name, "type")) + return; + if (g_strcmp0 (pspec->name, "type") == 0) g_object_notify (G_OBJECT (device), "kind"); else |