GNOME Bugzilla – Bug 625549
API change for GOConf change notifications
Last modified: 2010-07-30 14:18:42 UTC
When using gconf, go_conf_add_monitor (node, NULL, changed_cb, closure) used to pass the changed key to changed_cb. Since some times,the node path is used instead of the actually changed key. I'd prefer to come back to the previous solution (I'm using it in GChemPaint) even if it is not compatible with the keyfile version. Btw, I'll implement a GSettings version when GSettings appears in a stable glib release.
Here's the callback: cls->monitor (cls->node, cls->real_key, cls->data); It would appear that we do pass the key. (Line 442 of go-conf-gconf.c) Details, please.
Sample from GChemPaint: node = go_conf_get_node (NULL, "gchemutils/paint/settings") go_conf_add_monitor (node, NULL, (GOConfMonitorFunc) config_changed_cb, closure); the node has a lot of keys. If the font size is changed, config-changed-cb used to be passed key "/apps/gchemutils/paint/settings/font-size", but with the API change it is actually "/apps/gchemutils/paint/settings", so it is not easy to know what changed.
Ok, you are monitoring a whole tree. I wasn't even aware you could do that. I think we can restore matters with something like this. Could you please give it a try? static void cb_key_changed (GConfClient *client, G_GNUC_UNUSED guint cnxn_id, GConfEntry *entry, GOConfClosure *cls) { const char *key = entry && entry->key ? entry->key : cls->real_key; cls->monitor (cls->node, key, cls->data); }
it works, although I would use g_conk_entry_get_key (entry) instead of entry->key.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.