After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625549 - API change for GOConf change notifications
API change for GOConf change notifications
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-07-29 07:09 UTC by Jean Bréfort
Modified: 2010-07-30 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean Bréfort 2010-07-29 07:09:24 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.
Comment 1 Morten Welinder 2010-07-29 13:55:43 UTC
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.
Comment 2 Jean Bréfort 2010-07-30 07:08:01 UTC
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.
Comment 3 Morten Welinder 2010-07-30 13:23:41 UTC
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);
}
Comment 4 Jean Bréfort 2010-07-30 13:44:34 UTC
it works, although I would use g_conk_entry_get_key (entry) instead of entry->key.
Comment 5 Morten Welinder 2010-07-30 14:18:42 UTC
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.