[glibmm] Gio::Settings: Really add list_schemas().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Gio::Settings: Really add list_schemas().
- Date: Mon, 4 Apr 2011 08:45:53 +0000 (UTC)
commit 7ee784767b9311b3dfebad040fc895350cf5d6f6
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Apr 4 10:45:42 2011 +0200
Gio::Settings: Really add list_schemas().
* gio/src/gio_others.defs: Add g_settings_list_schemas(), though we do not
actually use this defnition yet. See below. This must be hand-written
because h2defs.py gets confused by the return type.
* gio/src/settings.[hg|ccg]: list_schemas(): Make this static and hand-code
it because gmmproc is confused by the declaration when it is static.
ChangeLog | 36 +++++++++++++++++++++++-------------
gio/src/gio_others.defs | 8 +++++---
gio/src/settings.ccg | 5 +++++
gio/src/settings.hg | 7 +++++--
4 files changed, 38 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ad956ad..34308a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,15 +1,25 @@
+2011-04-04 Murray Cumming <murrayc murrayc com>
+
+ Gio::Settings: Really add list_schemas().
+
+ * gio/src/gio_others.defs: Add g_settings_list_schemas(), though we do not
+ actually use this defnition yet. See below. This must be hand-written
+ because h2defs.py gets confused by the return type.
+ * gio/src/settings.[hg|ccg]: list_schemas(): Make this static and hand-code
+ it because gmmproc is confused by the declaration when it is static.
+
2011-04-02 Murray Cumming <murrayc murrayc com>
Gio::DBus examples: Renamed one and removed one.
- * examples/dbus/server.cc: Rename this to server_without_bus.cc to make its
- purpose clearer. This is not the common case. It is for private peer-to-peer
- connections not involving the usual session or system buses, or any bus
- for that matter. Meaning, for instance, that it does not assign names or
+ * examples/dbus/server.cc: Rename this to server_without_bus.cc to make its
+ purpose clearer. This is not the common case. It is for private peer-to-peer
+ connections not involving the usual session or system buses, or any bus
+ for that matter. Meaning, for instance, that it does not assign names or
provide introspection, I think.
- * examples/dbus/peer.cc: Removed this because it seems like just a
- complicated version of the server_without_bus example, and this is not in sync
- with the C versoin. Well, we should probably add a client for the server
+ * examples/dbus/peer.cc: Removed this because it seems like just a
+ complicated version of the server_without_bus example, and this is not in sync
+ with the C versoin. Well, we should probably add a client for the server
example.
* examples/Makefile.am: Adapted.
@@ -18,28 +28,28 @@
Slight cleanup to D-Bus example code.
* examples/dbus/server.cc:
- * examples/dbus/session_bus_service.cc: Remove code to handle the now
- non-existant GetStdOut D-Bus method. That code was left over from an earlier
+ * examples/dbus/session_bus_service.cc: Remove code to handle the now
+ non-existant GetStdOut D-Bus method. That code was left over from an earlier
version of an example.
2011-04-02 Murray Cumming <murrayc murrayc com>
Gio::DBus::NodeInfo::lookup_interface(): Add a method overload with no name.
- * gio/src/dbusintrospection.[hg|ccg]: Add a lookup_interface() method overload
- that just returns the first interface, avoiding the need to specify the name
+ * gio/src/dbusintrospection.[hg|ccg]: Add a lookup_interface() method overload
+ that just returns the first interface, avoiding the need to specify the name
when there is only one interface. The C API will not do this itself:
See bug #646417.
* examples/dbus/peer.cc:
* examples/dbus/server.cc:
- * examples/dbus/session_bus_service.cc: Use the new method to simplify the
+ * examples/dbus/session_bus_service.cc: Use the new method to simplify the
code slightly.
2011-04-02 Murray Cumming <murrayc murrayc com>
Gio::DBus::Connection: Added a register_method() overload with no vtable.
- * gio/src/dbusconnection.[hg|ccg]: This makes sense now that the C API's
+ * gio/src/dbusconnection.[hg|ccg]: This makes sense now that the C API's
documentation was improved in bug #646419.
2011-04-01 Murray Cumming <murrayc murrayc com>
diff --git a/gio/src/gio_others.defs b/gio/src/gio_others.defs
index 312c73c..43e27c8 100644
--- a/gio/src/gio_others.defs
+++ b/gio/src/gio_others.defs
@@ -11,6 +11,11 @@
(return-type "const-gchar*const*")
)
+(define-method list_schemas
+ (of-object "GSettingsBackend")
+ (c-name "g_settings_list_schemas")
+ (return-type "const-gchar*const*")
+)
; extra_defs does not generate these, for some reason. murrayc:
(define-signal changed
@@ -37,6 +42,3 @@
(return-type "void")
(when "last")
)
-
-
-
diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg
index 2af9f32..a37df2c 100644
--- a/gio/src/settings.ccg
+++ b/gio/src/settings.ccg
@@ -43,4 +43,9 @@ void Settings::bind_writable(const Glib::ustring& key,
bind_writable(key, property_proxy.get_object(), property_proxy.get_name(), inverted);
}
+std::vector<Glib::ustring> Settings::list_schemas()
+{
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_settings_list_schemas(), Glib::OWNERSHIP_NONE);
+}
+
}
diff --git a/gio/src/settings.hg b/gio/src/settings.hg
index 1afb614..1452873 100644
--- a/gio/src/settings.hg
+++ b/gio/src/settings.hg
@@ -97,8 +97,11 @@ public:
_WRAP_METHOD(void reset(const Glib::ustring& key), g_settings_reset)
-#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(std::vector<Glib::ustring> list_schemas() const, g_settings_list_schemas)
+//We must hand-code this because gmmproc is confused by the static keyword with the vector.
+//#m4 _CONVERSION(`const gchar*const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD_DOCS_ONLY(g_settings_list_schemas)
+ static std::vector<Glib::ustring> list_schemas();
+ _IGNORE(g_settings_list_schemas)
#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> list_children() const, g_settings_list_children)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]