GNOME Bugzilla – Bug 616307
Says GSettings key is not writable
Last modified: 2010-04-23 22:58:27 UTC
The commit at: http://git.gnome.org/browse/gnome-bluetooth/commit/?id=2e0a63705df026993f3741c491ce258876dca729 ports gnome-bluetooth to GSettings. I had to use the G_SETTINGS_BIND_NO_SENSITIVITY flag to g_settings_bind() because otherwise the widget was unsensitive. Bug in my code, installation problem?
hmm, no idea, really. The gconf backend has: static gboolean gconf_settings_backend_get_writable (GSettingsBackend *backend, const gchar *name) { GConfSettingsBackend *gconf = GCONF_SETTINGS_BACKEND (backend); /* We don't support checking writabality for a whole subpath, so we just say * it's not writable in such a case. */ if (name[strlen(name) - 1] == '/') return FALSE; return gconf_client_key_is_writable (gconf->priv->client, name, NULL); } Can you break in there and see what name is ?
It seems to work as expected now. I'll reopen if I can reproduce the problem.
Reopening. This happens when the key does not have a schema in GConf. The key is detected as not writable because it doesn't exist. You can see this when opening bluetooth-properties in gnome-bluetooth master for the first time.
$ GSETTINGS_BACKEND=gconf ./gsettings-tool --writable org.gnome.Bluetooth show-icon false $ ./gsettings-tool --writable org.gnome.Bluetooth show-icon true
$ p name $1 = (const gchar *) 0x608d20 "/apps/bluetooth-manager/show-icon" In gconf_client_key_is_writable(), the entry doesn't exist: 1198 g_return_val_if_fail (key != NULL, FALSE); 1199 g_return_val_if_fail (err == NULL || *err == NULL, FALSE); 1200 1201 if (gconf_client_lookup (client, key, &entry)) 1202 { 1203 if (!entry) 1204 return FALSE; So returns as not writable.
looks to me like that the last two lines need to be changed to if (!entry) return TRUE;
Ah, no, further down, we are also treating non-existing keys as non-writable.
Created attachment 159285 [details] [review] does this patch work for you ?
Created attachment 159319 [details] [review] Fix key writability when key does not exist If a key does not exist, it should be marked as writable, otherwise widget will end up unsensitive when g_settings_bind*() is used.
Comment on attachment 159285 [details] [review] does this patch work for you ? Missing the declaration for value.
Patch works for me.
I've committed this for 2.31.2