[gnome-color-manager] Emit ::changed on the public DBus interface when devices are added or removed



commit db46264cc8d84ec3a942bb24c88490f482143740
Author: Richard Hughes <richard hughsie com>
Date:   Thu Mar 25 15:56:46 2010 +0000

    Emit ::changed on the public DBus interface when devices are added or removed

 src/gcm-dbus.c                 |   14 ++++++++++++++
 src/org.gnome.ColorManager.xml |    2 +-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-dbus.c b/src/gcm-dbus.c
index 8ee1f9b..3c7425a 100644
--- a/src/gcm-dbus.c
+++ b/src/gcm-dbus.c
@@ -523,6 +523,16 @@ gcm_dbus_gconf_key_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *e
 }
 
 /**
+ * gcm_dbus_client_changed_cb:
+ **/
+static void
+gcm_dbus_client_changed_cb (GcmClient *client, GcmDevice *device, GcmDbus *dbus)
+{
+	/* just emit signal */
+	g_signal_emit (dbus, signals[SIGNAL_CHANGED], 0);
+}
+
+/**
  * gcm_dbus_init:
  * @dbus: This class instance
  **/
@@ -535,6 +545,10 @@ gcm_dbus_init (GcmDbus *dbus)
 	dbus->priv = GCM_DBUS_GET_PRIVATE (dbus);
 	dbus->priv->gconf_client = gconf_client_get_default ();
 	dbus->priv->client = gcm_client_new ();
+	g_signal_connect (dbus->priv->client, "added", G_CALLBACK (gcm_dbus_client_changed_cb), dbus);
+	g_signal_connect (dbus->priv->client, "removed", G_CALLBACK (gcm_dbus_client_changed_cb), dbus);
+	g_signal_connect (dbus->priv->client, "changed", G_CALLBACK (gcm_dbus_client_changed_cb), dbus);
+
 	gcm_client_set_use_threads (dbus->priv->client, TRUE);
 	dbus->priv->profile_store = gcm_profile_store_new ();
 	dbus->priv->timer = g_timer_new ();
diff --git a/src/org.gnome.ColorManager.xml b/src/org.gnome.ColorManager.xml
index 3562de5..74a1fd7 100644
--- a/src/org.gnome.ColorManager.xml
+++ b/src/org.gnome.ColorManager.xml
@@ -210,7 +210,7 @@
       <doc:doc>
         <doc:description>
           <doc:para>
-            Some value on the interface has changed.
+            Some value on the interface or the number of devices has changed.
           </doc:para>
         </doc:description>
       </doc:doc>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]