[glib/wip/settings-backend: 11/13] GSettingsBackend: drop 'default_value' arg on read



commit a24c18f7e095ae54af2a6620d1bc131eb64b9a64
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Jul 18 10:07:41 2012 -0400

    GSettingsBackend: drop 'default_value' arg on read
    
    With the removal of GDelayedSettingsBackend, this is only ever called
    with FALSE.  Remove it.

 gio/gkeyfilesettingsbackend.c  |    6 +-----
 gio/gmemorysettingsbackend.c   |    6 +-----
 gio/gnullsettingsbackend.c     |    3 +--
 gio/gsettings.c                |    2 +-
 gio/gsettingsbackend.c         |    5 ++---
 gio/gsettingsbackend.h         |    3 +--
 gio/gsettingsbackendinternal.h |    3 +--
 7 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
index cd001be..bd82685 100644
--- a/gio/gkeyfilesettingsbackend.c
+++ b/gio/gkeyfilesettingsbackend.c
@@ -251,14 +251,10 @@ set_to_keyfile (GKeyfileSettingsBackend *kfsb,
 static GVariant *
 g_keyfile_settings_backend_read (GSettingsBackend   *backend,
                                  const gchar        *key,
-                                 const GVariantType *expected_type,
-                                 gboolean            default_value)
+                                 const GVariantType *expected_type)
 {
   GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
 
-  if (default_value)
-    return NULL;
-
   return get_from_keyfile (kfsb, expected_type, key);
 }
 
diff --git a/gio/gmemorysettingsbackend.c b/gio/gmemorysettingsbackend.c
index d6eeb83..584caa8 100644
--- a/gio/gmemorysettingsbackend.c
+++ b/gio/gmemorysettingsbackend.c
@@ -47,15 +47,11 @@ G_DEFINE_TYPE_WITH_CODE (GMemorySettingsBackend,
 static GVariant *
 g_memory_settings_backend_read (GSettingsBackend   *backend,
                                 const gchar        *key,
-                                const GVariantType *expected_type,
-                                gboolean            default_value)
+                                const GVariantType *expected_type)
 {
   GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend);
   GVariant *value;
 
-  if (default_value)
-    return NULL;
-
   value = g_hash_table_lookup (memory->table, key);
 
   if (value != NULL)
diff --git a/gio/gnullsettingsbackend.c b/gio/gnullsettingsbackend.c
index a9f6d89..6ff8f5a 100644
--- a/gio/gnullsettingsbackend.c
+++ b/gio/gnullsettingsbackend.c
@@ -44,8 +44,7 @@ G_DEFINE_TYPE_WITH_CODE (GNullSettingsBackend,
 static GVariant *
 g_null_settings_backend_read (GSettingsBackend   *backend,
                               const gchar        *key,
-                              const GVariantType *expected_type,
-                              gboolean            default_value)
+                              const GVariantType *expected_type)
 {
   return NULL;
 }
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 776ed77..f95b728 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -1105,7 +1105,7 @@ g_settings_read_from_backend (GSettings          *settings,
   gchar *path;
 
   path = g_strconcat (settings->priv->path, key->name, NULL);
-  value = g_settings_backend_read (settings->priv->backend, path, key->type, FALSE);
+  value = g_settings_backend_read (settings->priv->backend, path, key->type);
   g_free (path);
 
   if (value != NULL)
diff --git a/gio/gsettingsbackend.c b/gio/gsettingsbackend.c
index 2a24289..9cafe9b 100644
--- a/gio/gsettingsbackend.c
+++ b/gio/gsettingsbackend.c
@@ -511,13 +511,12 @@ g_settings_backend_changed_tree (GSettingsBackend *backend,
 GVariant *
 g_settings_backend_read (GSettingsBackend   *backend,
                          const gchar        *key,
-                         const GVariantType *expected_type,
-                         gboolean            default_value)
+                         const GVariantType *expected_type)
 {
   GVariant *value;
 
   value = G_SETTINGS_BACKEND_GET_CLASS (backend)
-    ->read (backend, key, expected_type, default_value);
+    ->read (backend, key, expected_type);
 
   if (value != NULL)
     value = g_variant_take_ref (value);
diff --git a/gio/gsettingsbackend.h b/gio/gsettingsbackend.h
index b707148..c6624bd 100644
--- a/gio/gsettingsbackend.h
+++ b/gio/gsettingsbackend.h
@@ -67,8 +67,7 @@ struct _GSettingsBackendClass
 
   GVariant *         (* read)           (GSettingsBackend    *backend,
                                          const gchar         *key,
-                                         const GVariantType  *expected_type,
-                                         gboolean             default_value);
+                                         const GVariantType  *expected_type);
 
   gboolean           (* get_writable)   (GSettingsBackend    *backend,
                                          const gchar         *key);
diff --git a/gio/gsettingsbackendinternal.h b/gio/gsettingsbackendinternal.h
index c906343..ca1402a 100644
--- a/gio/gsettingsbackendinternal.h
+++ b/gio/gsettingsbackendinternal.h
@@ -43,8 +43,7 @@ GTree *                 g_settings_backend_create_tree                  (void);
 G_GNUC_INTERNAL
 GVariant *              g_settings_backend_read                         (GSettingsBackend     *backend,
                                                                          const gchar          *key,
-                                                                         const GVariantType   *expected_type,
-                                                                         gboolean              default_value);
+                                                                         const GVariantType   *expected_type);
 G_GNUC_INTERNAL
 gboolean                g_settings_backend_write                        (GSettingsBackend     *backend,
                                                                          const gchar          *key,



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