[glib/wip/settings-backend: 10/14] GSettingsBackend: drop the concept of 'origin_tag'



commit 55005057d2ccd413a14ed6048d50a364874659f9
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Dec 30 00:54:57 2011 -0500

    GSettingsBackend: drop the concept of 'origin_tag'
    
    This was only used by the (now removed) delayed settings backend.

 gio/gkeyfilesettingsbackend.c  |   12 +++++-------
 gio/gmemorysettingsbackend.c   |   10 ++++------
 gio/gnullsettingsbackend.c     |    6 ++----
 gio/gregistrysettingsbackend.c |   10 ++++------
 gio/gsettings.c                |    4 ++--
 gio/gsettingsbackend.c         |   39 +++++++++------------------------------
 gio/gsettingsbackend.h         |   19 ++++++-------------
 gio/gsettingsbackendinternal.h |    6 ++----
 8 files changed, 34 insertions(+), 72 deletions(-)
---
diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
index 77c25d1..cd001be 100644
--- a/gio/gkeyfilesettingsbackend.c
+++ b/gio/gkeyfilesettingsbackend.c
@@ -265,8 +265,7 @@ g_keyfile_settings_backend_read (GSettingsBackend   *backend,
 static gboolean
 g_keyfile_settings_backend_write (GSettingsBackend *backend,
                                   const gchar      *key,
-                                  GVariant         *value,
-                                  gpointer          origin_tag)
+                                  GVariant         *value)
 {
   GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
   gboolean success;
@@ -278,7 +277,7 @@ g_keyfile_settings_backend_write (GSettingsBackend *backend,
 
   if (success)
     {
-      g_settings_backend_changed (backend, key, origin_tag);
+      g_settings_backend_changed (backend, key);
       g_keyfile_settings_backend_keyfile_write (kfsb);
     }
 
@@ -287,15 +286,14 @@ g_keyfile_settings_backend_write (GSettingsBackend *backend,
 
 static void
 g_keyfile_settings_backend_reset (GSettingsBackend *backend,
-                                  const gchar      *key,
-                                  gpointer          origin_tag)
+                                  const gchar      *key)
 {
   GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
 
   if (set_to_keyfile (kfsb, key, NULL))
     g_keyfile_settings_backend_keyfile_write (kfsb);
 
-  g_settings_backend_changed (backend, key, origin_tag);
+  g_settings_backend_changed (backend, key);
 }
 
 static gboolean
@@ -407,7 +405,7 @@ g_keyfile_settings_backend_keyfile_reload (GKeyfileSettingsBackend *kfsb)
       kfsb->keyfile = keyfiles[1];
 
       if (g_tree_nnodes (tree) > 0)
-        g_settings_backend_changed_tree (&kfsb->parent_instance, tree, NULL);
+        g_settings_backend_changed_tree (&kfsb->parent_instance, tree);
 
       g_tree_unref (tree);
 
diff --git a/gio/gmemorysettingsbackend.c b/gio/gmemorysettingsbackend.c
index 4b577f0..d6eeb83 100644
--- a/gio/gmemorysettingsbackend.c
+++ b/gio/gmemorysettingsbackend.c
@@ -67,8 +67,7 @@ g_memory_settings_backend_read (GSettingsBackend   *backend,
 static gboolean
 g_memory_settings_backend_write (GSettingsBackend *backend,
                                  const gchar      *key,
-                                 GVariant         *value,
-                                 gpointer          origin_tag)
+                                 GVariant         *value)
 {
   GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend);
   GVariant *old_value;
@@ -79,7 +78,7 @@ g_memory_settings_backend_write (GSettingsBackend *backend,
   if (old_value == NULL || !g_variant_equal (value, old_value))
     {
       g_hash_table_insert (memory->table, g_strdup (key), value);
-      g_settings_backend_changed (backend, key, origin_tag);
+      g_settings_backend_changed (backend, key);
     }
   else
     g_variant_unref (value);
@@ -89,15 +88,14 @@ g_memory_settings_backend_write (GSettingsBackend *backend,
 
 static void
 g_memory_settings_backend_reset (GSettingsBackend *backend,
-                                 const gchar      *key,
-                                 gpointer          origin_tag)
+                                 const gchar      *key)
 {
   GMemorySettingsBackend *memory = G_MEMORY_SETTINGS_BACKEND (backend);
 
   if (g_hash_table_lookup (memory->table, key))
     {
       g_hash_table_remove (memory->table, key);
-      g_settings_backend_changed (backend, key, origin_tag);
+      g_settings_backend_changed (backend, key);
     }
 }
 
diff --git a/gio/gnullsettingsbackend.c b/gio/gnullsettingsbackend.c
index d49d45d..a9f6d89 100644
--- a/gio/gnullsettingsbackend.c
+++ b/gio/gnullsettingsbackend.c
@@ -53,8 +53,7 @@ g_null_settings_backend_read (GSettingsBackend   *backend,
 static gboolean
 g_null_settings_backend_write (GSettingsBackend *backend,
                                const gchar      *key,
-                               GVariant         *value,
-                               gpointer          origin_tag)
+                               GVariant         *value)
 {
   if (value)
     g_variant_unref (g_variant_ref_sink (value));
@@ -63,8 +62,7 @@ g_null_settings_backend_write (GSettingsBackend *backend,
 
 static void
 g_null_settings_backend_reset (GSettingsBackend *backend,
-                               const gchar      *key,
-                               gpointer          origin_tag)
+                               const gchar      *key)
 {
 }
 
diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c
index 6b4ddca..cc1d1a7 100644
--- a/gio/gregistrysettingsbackend.c
+++ b/gio/gregistrysettingsbackend.c
@@ -1007,8 +1007,7 @@ g_registry_backend_write_one (const char *key_name,
 static gboolean
 g_registry_backend_write (GSettingsBackend *backend,
                           const gchar      *key_name,
-                          GVariant         *value,
-                          gpointer          origin_tag)
+                          GVariant         *value)
 {
   GRegistryBackend *self = G_REGISTRY_BACKEND (backend);
   LONG result;
@@ -1025,7 +1024,7 @@ g_registry_backend_write (GSettingsBackend *backend,
   action.self = self;
   action.hroot = hroot;
   g_registry_backend_write_one (key_name, value, &action);
-  g_settings_backend_changed (backend, key_name, origin_tag);
+  g_settings_backend_changed (backend, key_name);
 
   RegCloseKey (hroot);
 
@@ -1034,8 +1033,7 @@ g_registry_backend_write (GSettingsBackend *backend,
 
 static void
 g_registry_backend_reset (GSettingsBackend *backend,
-                          const gchar      *key_name,
-                          gpointer          origin_tag)
+                          const gchar      *key_name)
 {
   GRegistryBackend *self = G_REGISTRY_BACKEND (backend);
   gchar *path_name, *value_name = NULL;
@@ -1074,7 +1072,7 @@ g_registry_backend_reset (GSettingsBackend *backend,
   g_free (path_name);
 
 
-  g_settings_backend_changed (backend, key_name, origin_tag);
+  g_settings_backend_changed (backend, key_name);
 }
 
 /* Not implemented and probably beyond the scope of this backend */
diff --git a/gio/gsettings.c b/gio/gsettings.c
index f549c7b..776ed77 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -1090,7 +1090,7 @@ g_settings_write_to_backend (GSettings          *settings,
   gchar *path;
 
   path = g_strconcat (settings->priv->path, key->name, NULL);
-  success = g_settings_backend_write (settings->priv->backend, path, value, NULL);
+  success = g_settings_backend_write (settings->priv->backend, path, value);
   g_free (path);
 
   return success;
@@ -2050,7 +2050,7 @@ g_settings_reset (GSettings *settings,
   gchar *path;
 
   path = g_strconcat (settings->priv->path, key, NULL);
-  g_settings_backend_reset (settings->priv->backend, path, NULL);
+  g_settings_backend_reset (settings->priv->backend, path);
   g_free (path);
 }
 
diff --git a/gio/gsettingsbackend.c b/gio/gsettingsbackend.c
index 26c9c95..2a24289 100644
--- a/gio/gsettingsbackend.c
+++ b/gio/gsettingsbackend.c
@@ -144,7 +144,6 @@ g_settings_backend_event (GSettingsBackend     *backend,
  * g_settings_backend_changed:
  * @backend: a #GSettingsBackend implementation
  * @key: the name of the key
- * @origin_tag: the origin tag
  *
  * Signals that a single key has possibly changed.  Backend
  * implementations should call this if a key has possibly changed its
@@ -165,16 +164,11 @@ g_settings_backend_event (GSettingsBackend     *backend,
  * in response to any other action (including from calls to
  * g_settings_backend_write()).
  *
- * In the case that this call is in response to a call to
- * g_settings_backend_write() then @origin_tag must be set to the same
- * value that was passed to that call.
- *
  * Since: 2.26
  **/
 void
 g_settings_backend_changed (GSettingsBackend *backend,
-                            const gchar      *key,
-                            gpointer          origin_tag)
+                            const gchar      *key)
 {
   GSettingsEvent event;
   gchar *null = NULL;
@@ -185,7 +179,6 @@ g_settings_backend_changed (GSettingsBackend *backend,
   event.type = G_SETTINGS_EVENT_CHANGE;
   event.prefix = (gchar *) key;
   event.keys = &null;
-  event.origin_tag = origin_tag;
 
   g_settings_backend_event (backend, &event);
 }
@@ -195,7 +188,6 @@ g_settings_backend_changed (GSettingsBackend *backend,
  * @backend: a #GSettingsBackend implementation
  * @path: the path containing the changes
  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
- * @origin_tag: the origin tag
  *
  * Signals that a list of keys have possibly changed.  Backend
  * implementations should call this if keys have possibly changed their
@@ -224,8 +216,7 @@ g_settings_backend_changed (GSettingsBackend *backend,
 void
 g_settings_backend_keys_changed (GSettingsBackend    *backend,
                                  const gchar         *path,
-                                 gchar const * const *items,
-                                 gpointer             origin_tag)
+                                 gchar const * const *items)
 {
   GSettingsEvent event;
 
@@ -238,7 +229,6 @@ g_settings_backend_keys_changed (GSettingsBackend    *backend,
   event.type = G_SETTINGS_EVENT_CHANGE;
   event.prefix = (gchar *) path;
   event.keys = (gchar **) items;
-  event.origin_tag = origin_tag;
 
   g_settings_backend_event (backend, &event);
 }
@@ -247,7 +237,6 @@ g_settings_backend_keys_changed (GSettingsBackend    *backend,
  * g_settings_backend_path_changed:
  * @backend: a #GSettingsBackend implementation
  * @path: the path containing the changes
- * @origin_tag: the origin tag
  *
  * Signals that all keys below a given path may have possibly changed.
  * Backend implementations should call this if an entire path of keys
@@ -275,8 +264,7 @@ g_settings_backend_keys_changed (GSettingsBackend    *backend,
  */
 void
 g_settings_backend_path_changed (GSettingsBackend *backend,
-                                 const gchar      *path,
-                                 gpointer          origin_tag)
+                                 const gchar      *path)
 {
   GSettingsEvent event;
   gchar *null = NULL;
@@ -287,7 +275,6 @@ g_settings_backend_path_changed (GSettingsBackend *backend,
   event.type = G_SETTINGS_EVENT_CHANGE;
   event.prefix = (gchar *) path;
   event.keys = &null;
-  event.origin_tag = origin_tag;
 
   g_settings_backend_event (backend, &event);
 }
@@ -317,7 +304,6 @@ g_settings_backend_writable_changed (GSettingsBackend *backend,
   event.type = G_SETTINGS_EVENT_WRITABLE_CHANGE;
   event.prefix = (gchar *) key;
   event.keys = &null;
-  event.origin_tag = NULL;
 
   g_settings_backend_event (backend, &event);
 }
@@ -348,7 +334,6 @@ g_settings_backend_path_writable_changed (GSettingsBackend *backend,
   event.type = G_SETTINGS_EVENT_WRITABLE_CHANGE;
   event.prefix = (gchar *) path;
   event.keys = &null;
-  event.origin_tag = NULL;
 
   g_settings_backend_event (backend, &event);
 }
@@ -466,7 +451,6 @@ g_settings_backend_flatten_tree (GTree         *tree,
  * g_settings_backend_changed_tree:
  * @backend: a #GSettingsBackend implementation
  * @tree: a #GTree containing the changes
- * @origin_tag: the origin tag
  *
  * This call is a convenience wrapper.  It gets the list of changes from
  * @tree, computes the longest common prefix and calls
@@ -476,8 +460,7 @@ g_settings_backend_flatten_tree (GTree         *tree,
  **/
 void
 g_settings_backend_changed_tree (GSettingsBackend *backend,
-                                 GTree            *tree,
-                                 gpointer          origin_tag)
+                                 GTree            *tree)
 {
   const gchar **keys;
   gchar *path;
@@ -498,7 +481,7 @@ g_settings_backend_changed_tree (GSettingsBackend *backend,
   }
 #endif
 
-  g_settings_backend_keys_changed (backend, path, keys, origin_tag);
+  g_settings_backend_keys_changed (backend, path, keys);
   g_free (path);
   g_free (keys);
 }
@@ -553,7 +536,6 @@ g_settings_backend_read (GSettingsBackend   *backend,
  * @backend: a #GSettingsBackend implementation
  * @key: the name of the key
  * @value: a #GVariant value to write to this key
- * @origin_tag: the origin tag
  *
  * Writes exactly one key.
  *
@@ -572,14 +554,13 @@ g_settings_backend_read (GSettingsBackend   *backend,
 gboolean
 g_settings_backend_write (GSettingsBackend *backend,
                           const gchar      *key,
-                          GVariant         *value,
-                          gpointer          origin_tag)
+                          GVariant         *value)
 {
   gboolean success;
 
   g_variant_ref_sink (value);
   success = G_SETTINGS_BACKEND_GET_CLASS (backend)
-    ->write (backend, key, value, origin_tag);
+    ->write (backend, key, value);
   g_variant_unref (value);
 
   return success;
@@ -589,7 +570,6 @@ g_settings_backend_write (GSettingsBackend *backend,
  * g_settings_backend_reset:
  * @backend: a #GSettingsBackend implementation
  * @key: the name of a key
- * @origin_tag: the origin tag
  *
  * "Resets" the named key to its "default" value (ie: after system-wide
  * defaults, mandatory keys, etc. have been taken into account) or possibly
@@ -597,11 +577,10 @@ g_settings_backend_write (GSettingsBackend *backend,
  */
 void
 g_settings_backend_reset (GSettingsBackend *backend,
-                          const gchar      *key,
-                          gpointer          origin_tag)
+                          const gchar      *key)
 {
   G_SETTINGS_BACKEND_GET_CLASS (backend)
-    ->reset (backend, key, origin_tag);
+    ->reset (backend, key);
 }
 
 /*< private >
diff --git a/gio/gsettingsbackend.h b/gio/gsettingsbackend.h
index c3d0eb3..b707148 100644
--- a/gio/gsettingsbackend.h
+++ b/gio/gsettingsbackend.h
@@ -75,11 +75,9 @@ struct _GSettingsBackendClass
 
   gboolean           (* write)          (GSettingsBackend    *backend,
                                          const gchar         *key,
-                                         GVariant            *value,
-                                         gpointer             origin_tag);
+                                         GVariant            *value);
   void               (* reset)          (GSettingsBackend    *backend,
-                                         const gchar         *key,
-                                         gpointer             origin_tag);
+                                         const gchar         *key);
 
   void               (* subscribe)      (GSettingsBackend    *backend,
                                          const gchar         *name);
@@ -116,7 +114,6 @@ typedef struct
   GSettingsEventType   type;
   gchar               *prefix;
   gchar              **keys;
-  gpointer             origin_tag;
 } GSettingsEvent;
 
 GType                   g_settings_backend_get_type                     (void);
@@ -126,27 +123,23 @@ void                    g_settings_backend_event                        (GSettin
 void                    g_settings_backend_set_has_unapplied            (GSettingsBackend     *backend,
                                                                          gboolean              has_unapplied);
 void                    g_settings_backend_changed                      (GSettingsBackend     *backend,
-                                                                         const gchar          *key,
-                                                                         gpointer              origin_tag);
+                                                                         const gchar          *key);
 void                    g_settings_backend_path_changed                 (GSettingsBackend     *backend,
-                                                                         const gchar          *path,
-                                                                         gpointer              origin_tag);
+                                                                         const gchar          *path);
 void                    g_settings_backend_flatten_tree                 (GTree                *tree,
                                                                          gchar               **path,
                                                                          const gchar        ***keys,
                                                                          GVariant           ***values);
 void                    g_settings_backend_keys_changed                 (GSettingsBackend     *backend,
                                                                          const gchar          *path,
-                                                                         gchar const * const  *items,
-                                                                         gpointer              origin_tag);
+                                                                         gchar const * const  *items);
 
 void                    g_settings_backend_path_writable_changed        (GSettingsBackend     *backend,
                                                                          const gchar          *path);
 void                    g_settings_backend_writable_changed             (GSettingsBackend     *backend,
                                                                          const gchar          *key);
 void                    g_settings_backend_changed_tree                 (GSettingsBackend     *backend,
-                                                                         GTree                *tree,
-                                                                         gpointer              origin_tag);
+                                                                         GTree                *tree);
 
 GSettingsBackend *      g_settings_backend_get_default                  (void);
 
diff --git a/gio/gsettingsbackendinternal.h b/gio/gsettingsbackendinternal.h
index aea3cb2..c906343 100644
--- a/gio/gsettingsbackendinternal.h
+++ b/gio/gsettingsbackendinternal.h
@@ -48,12 +48,10 @@ GVariant *              g_settings_backend_read                         (GSettin
 G_GNUC_INTERNAL
 gboolean                g_settings_backend_write                        (GSettingsBackend     *backend,
                                                                          const gchar          *key,
-                                                                         GVariant             *value,
-                                                                         gpointer              origin_tag);
+                                                                         GVariant             *value);
 G_GNUC_INTERNAL
 void                    g_settings_backend_reset                        (GSettingsBackend     *backend,
-                                                                         const gchar          *key,
-                                                                         gpointer              origin_tag);
+                                                                         const gchar          *key);
 G_GNUC_INTERNAL
 gboolean                g_settings_backend_get_writable                 (GSettingsBackend     *backend,
                                                                          const char           *key);



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