[gconf] Fix key writability when key does not exist
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gconf] Fix key writability when key does not exist
- Date: Fri, 23 Apr 2010 00:24:15 +0000 (UTC)
commit 1573fded60055196b5d9fbd068f69a8cc7e2416b
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Apr 22 20:20:36 2010 -0400
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.
Bug 616307.
gsettings/gconfsettingsbackend.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gsettings/gconfsettingsbackend.c b/gsettings/gconfsettingsbackend.c
index e76a3a3..77e8df8 100644
--- a/gsettings/gconfsettingsbackend.c
+++ b/gsettings/gconfsettingsbackend.c
@@ -799,12 +799,19 @@ gconf_settings_backend_get_writable (GSettingsBackend *backend,
const gchar *name)
{
GConfSettingsBackend *gconf = GCONF_SETTINGS_BACKEND (backend);
+ GConfValue *value;
/* 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;
+ value = gconf_client_get (gconf->priv->client, name, NULL);
+ if (value == NULL)
+ return TRUE;
+ else
+ gconf_value_free (value);
+
return gconf_client_key_is_writable (gconf->priv->client, name, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]