[glib/gsettings] GSettings: implement 'is_writable', fix an XXX



commit 4eaeaf17cb222d98c24a26560a57542e8e2b4b33
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Sep 30 13:51:57 2009 -0400

    GSettings: implement 'is_writable', fix an XXX

 gio/gsettings.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettings.c b/gio/gsettings.c
index e3c985d..1663371 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -523,7 +523,7 @@ g_settings_get_value (GSettings   *settings,
 
   path = g_strconcat (settings->priv->base_path, key, NULL);
   format = g_settings_schema_get_key_format (settings->priv->schema, key);
-  type = G_VARIANT_TYPE (format); /* XXX this is not valid. */
+  type = g_settings_schema_get_key_type (settings->priv->schema, key);
   value = g_settings_backend_read (settings->priv->backend, path, type);
   g_free (path);
 
@@ -612,7 +612,14 @@ gboolean
 g_settings_is_writable (GSettings   *settings,
                         const gchar *name)
 {
-  return TRUE;
+  gboolean writable;
+  gchar *path;
+
+  path = g_strconcat (settings->priv->base_path, name, NULL);
+  writable = g_settings_backend_get_writable (settings->priv->backend, path);
+  g_free (path);
+
+  return writable;
 }
 
 void



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