[goffice] goconf: fix problem with callbacks.



commit 58eed695963d737c1d512335022eaa3b00c793d9
Author: Morten Welinder <terra gnome org>
Date:   Fri Jul 30 10:16:15 2010 -0400

    goconf: fix problem with callbacks.

 ChangeLog                   |    5 +++++
 NEWS                        |    1 +
 goffice/app/go-conf-gconf.c |   12 ++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4d7b55e..64749d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-30  Morten Welinder  <terra gnome org>
+
+	* goffice/app/go-conf-gconf.c (cb_key_changed): Send the full key
+	to callback.
+
 2010-07-27  Morten Welinder  <terra gnome org>
 
 	* goffice/math/go-math.c: Use go_finitel as appropriate.
diff --git a/NEWS b/NEWS
index da67452..20e4312 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Jean:
 Morten:
 	* Add go_string_replace function.
 	* Add functions to manage GOFormatDetails.
+	* Fix go_conf notification problem.  [#625549]
 
 --------------------------------------------------------------------------
 goffice 0.8.7:
diff --git a/goffice/app/go-conf-gconf.c b/goffice/app/go-conf-gconf.c
index 27330cf..392c3b3 100644
--- a/goffice/app/go-conf-gconf.c
+++ b/goffice/app/go-conf-gconf.c
@@ -435,10 +435,18 @@ go_conf_remove_monitor (guint monitor_id)
 static void
 cb_key_changed (GConfClient *client,
 		G_GNUC_UNUSED guint cnxn_id,
-		G_GNUC_UNUSED GConfEntry *entry,
+		GConfEntry *entry,
 		GOConfClosure *cls)
 {
-	cls->monitor (cls->node, cls->real_key, cls->data);
+	/*
+	 * We get the key from the entry in case we are monitoring a
+	 * directory.  I am not sure such monitoring was intended, but
+	 * it has been used.  It is unlikely to work with the other
+	 * backends.
+	 */
+	const char *entry_key = entry ? gconf_entry_get_key (entry) : NULL;
+        const char *key = entry_key ? entry_key : cls->real_key;
+	cls->monitor (cls->node, key, cls->data);
 }
 
 guint



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