Make the memory and null settings backends public
authorChristian Persch <chpe@gnome.org>
Sun, 5 Dec 2010 14:34:26 +0000 (15:34 +0100)
committerChristian Persch <chpe@gnome.org>
Wed, 5 Jan 2011 19:31:50 +0000 (20:31 +0100)
Bug #636806.

docs/reference/gio/gio-sections.txt
gio/Makefile.am
gio/gio.symbols
gio/giomodule.c
gio/gmemorysettingsbackend.c
gio/gmemorysettingsbackend.h [deleted file]
gio/gnullsettingsbackend.c
gio/gnullsettingsbackend.h [deleted file]
gio/gsettingsbackend.c
gio/gsettingsbackend.h
gio/gsettingsbackendinternal.h

index 2facc21..3448e8c 100644 (file)
@@ -2158,6 +2158,7 @@ G_TYPE_FILE_DESCRIPTOR_BASED
 GSettingsBackend
 GSettingsBackendClass
 G_SETTINGS_BACKEND_EXTENSION_POINT_NAME
+g_settings_backend_get_default
 g_settings_backend_changed
 g_settings_backend_path_changed
 g_settings_backend_keys_changed
@@ -2166,6 +2167,8 @@ g_settings_backend_writable_changed
 g_settings_backend_changed_tree
 g_settings_backend_flatten_tree
 g_keyfile_settings_backend_new
+g_memory_settings_backend_new
+g_null_settings_backend_new
 
 <SUBSECTION Standard>
 G_IS_SETTINGS_BACKEND
index e0b352e..0fa675f 100644 (file)
@@ -116,9 +116,7 @@ settings_sources = \
        gdelayedsettingsbackend.h       \
        gdelayedsettingsbackend.c       \
        gkeyfilesettingsbackend.c       \
-       gmemorysettingsbackend.h        \
        gmemorysettingsbackend.c        \
-       gnullsettingsbackend.h          \
        gnullsettingsbackend.c          \
        gsettingsbackendinternal.h      \
        gsettingsbackend.c              \
index dc03066..d7f7fa8 100644 (file)
@@ -1544,13 +1544,20 @@ g_settings_backend_path_changed
 g_settings_backend_path_writable_changed
 g_settings_backend_writable_changed
 g_settings_backend_changed_tree
-#endif
+g_settings_backend_get_default
 #endif
 
-#if IN_HEADER(__G_SETTINGS_BACKEND_H__)
 #if IN_FILE(__G_KEYFILE_SETTINGS_BACKEND_C__)
 g_keyfile_settings_backend_new
 #endif
+
+#if IN_FILE(__G_MEMORY_SETTINGS_BACKEND_C__)
+g_memory_settings_backend_new
+#endif
+
+#if IN_FILE(__G_NULL_SETTINGS_BACKEND_C__)
+g_null_settings_backend_new
+#endif
 #endif
 
 #if IN_HEADER(__G_SETTINGS_H__)
index cb05270..00e8c48 100644 (file)
 
 #include "giomodule.h"
 #include "giomodule-priv.h"
-#include "gmemorysettingsbackend.h"
 #include "glocalfilemonitor.h"
 #include "glocaldirectorymonitor.h"
 #include "gnativevolumemonitor.h"
 #include "gproxyresolver.h"
 #include "gproxy.h"
+#include "gsettingsbackendinternal.h"
 #include "gsocks4proxy.h"
 #include "gsocks4aproxy.h"
 #include "gsocks5proxy.h"
@@ -598,6 +598,7 @@ _g_io_modules_ensure_loaded (void)
        }
 
       /* Initialize types from built-in "modules" */
+      g_null_settings_backend_get_type ();
       g_memory_settings_backend_get_type ();
 #if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H)
       _g_inotify_directory_monitor_get_type ();
index 6b60058..5d747b5 100644 (file)
@@ -21,9 +21,8 @@
 
 #include "config.h"
 
-#include "gmemorysettingsbackend.h"
 #include "gsimplepermission.h"
-#include "gsettingsbackend.h"
+#include "gsettingsbackendinternal.h"
 #include "giomodule.h"
 
 
@@ -174,3 +173,9 @@ g_memory_settings_backend_class_init (GMemorySettingsBackendClass *class)
   backend_class->get_permission = g_memory_settings_backend_get_permission;
   object_class->finalize = g_memory_settings_backend_finalize;
 }
+
+GSettingsBackend *
+g_memory_settings_backend_new (void)
+{
+  return g_object_new (G_TYPE_MEMORY_SETTINGS_BACKEND, NULL);
+}
diff --git a/gio/gmemorysettingsbackend.h b/gio/gmemorysettingsbackend.h
deleted file mode 100644 (file)
index 9b7756c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2010 Codethink Limited
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the licence, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ryan Lortie <desrt@desrt.ca>
- */
-
-#ifndef __GMEMORY_SETTINGS_BACKEND_H__
-#define __GMEMORY_SETTINGS_BACKEND_H__
-
-#include <glib-object.h>
-
-G_GNUC_INTERNAL
-GType g_memory_settings_backend_get_type (void);
-
-#endif /* __G_MEMORY_SETTINGS_BACKEND_H__ */
index a2bead0..507aa8c 100644 (file)
@@ -21,7 +21,8 @@
 
 #include "config.h"
 
-#include "gnullsettingsbackend.h"
+#include "gsettingsbackendinternal.h"
+#include "giomodule.h"
 #include "gsimplepermission.h"
 
 
 typedef GSettingsBackendClass GNullSettingsBackendClass;
 typedef GSettingsBackend      GNullSettingsBackend;
 
-static GType g_null_settings_backend_get_type (void);
-G_DEFINE_TYPE (GNullSettingsBackend,
-               g_null_settings_backend,
-               G_TYPE_SETTINGS_BACKEND)
+G_DEFINE_TYPE_WITH_CODE (GNullSettingsBackend,
+                         g_null_settings_backend,
+                         G_TYPE_SETTINGS_BACKEND,
+                         g_io_extension_point_implement (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME,
+                                                         g_define_type_id, "null", 10))
 
 static GVariant *
 g_null_settings_backend_read (GSettingsBackend   *backend,
diff --git a/gio/gnullsettingsbackend.h b/gio/gnullsettingsbackend.h
deleted file mode 100644 (file)
index ea07f52..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2010 Codethink Limited
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the licence, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ryan Lortie <desrt@desrt.ca>
- */
-
-#ifndef __G_NULL_SETTINGS_BACKEND_H__
-#define __G_NULL_SETTINGS_BACKEND_H__
-
-#include <gio/gsettingsbackend.h>
-
-G_GNUC_INTERNAL
-GSettingsBackend * g_null_settings_backend_new (void);
-
-#endif /* __G_NULL_SETTINGS_BACKEND_H__ */
index bd2fa2e..029e826 100644 (file)
@@ -24,7 +24,6 @@
 #include "config.h"
 
 #include "gsettingsbackendinternal.h"
-#include "gnullsettingsbackend.h"
 #include "gsimplepermission.h"
 #include "giomodule-priv.h"
 #include "gio-marshal.h"
@@ -925,7 +924,7 @@ g_settings_backend_create_tree (void)
                           g_free, (GDestroyNotify) g_variant_unref);
 }
 
-/*< private >
+/**
  * g_settings_backend_get_default:
  * @returns: the default #GSettingsBackend
  *
@@ -934,6 +933,8 @@ g_settings_backend_create_tree (void)
  * environment variable to the name of a settings backend.
  *
  * The user gets a reference to the backend.
+ *
+ * Since: 2.28
  */
 GSettingsBackend *
 g_settings_backend_get_default (void)
index 3705ee5..e674187 100644 (file)
@@ -129,10 +129,16 @@ void                    g_settings_backend_changed_tree                 (GSettin
                                                                          GTree               *tree,
                                                                          gpointer             origin_tag);
 
+GSettingsBackend *      g_settings_backend_get_default                  (void);
+
 GSettingsBackend *      g_keyfile_settings_backend_new                  (const gchar         *filename,
                                                                          const gchar         *root_path,
                                                                          const gchar         *root_group);
 
+GSettingsBackend *      g_null_settings_backend_new                     (void);
+
+GSettingsBackend *      g_memory_settings_backend_new                   (void);
+
 G_END_DECLS
 
 #endif /* __G_SETTINGS_BACKEND_H__ */
index a6711cb..e009b31 100644 (file)
@@ -92,8 +92,12 @@ G_GNUC_INTERNAL
 GPermission *           g_settings_backend_get_permission               (GSettingsBackend               *backend,
                                                                          const gchar                    *path);
 G_GNUC_INTERNAL
-GSettingsBackend *      g_settings_backend_get_default                  (void);
-G_GNUC_INTERNAL
 void                    g_settings_backend_sync_default                 (void);
 
+G_GNUC_INTERNAL
+GType                   g_null_settings_backend_get_type                (void);
+
+G_GNUC_INTERNAL
+GType                   g_memory_settings_backend_get_type              (void);
+
 #endif  /* __G_SETTINGS_BACKEND_INTERNAL_H__ */