[glibmm/wip/dboles/SettingsSchemaSource-Issue#19: 12/12] SettingsSchemaSource: Wrap new_from_directory()



commit 3edb73adcf9d82986817777c0e3f2da109e91e8c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat Nov 16 20:06:00 2019 +0000

    SettingsSchemaSource: Wrap new_from_directory()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783216
    https://gitlab.gnome.org/GNOME/glibmm/issues/19

 gio/src/settingsschemasource.hg | 11 ++++-------
 tools/m4/convert_gio.m4         |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/gio/src/settingsschemasource.hg b/gio/src/settingsschemasource.hg
index 69170794..878bc6c0 100644
--- a/gio/src/settingsschemasource.hg
+++ b/gio/src/settingsschemasource.hg
@@ -47,13 +47,10 @@ protected:
 public:
   _WRAP_METHOD(static Glib::RefPtr<SettingsSchemaSource> get_default(), 
g_settings_schema_source_get_default, refreturn)
 
-/* TODO:
-GLIB_AVAILABLE_IN_2_32
-GSettingsSchemaSource * g_settings_schema_source_new_from_directory     (const gchar            *directory,
-                                                                         GSettingsSchemaSource  *parent,
-                                                                         gboolean                trusted,
-                                                                         GError                **error);
-*/
+  _WRAP_METHOD(static Glib::RefPtr<SettingsSchemaSource> create(
+    const std::string& directory, bool trusted{.},
+    const Glib::RefPtr<SettingsSchemaSource>& parent{.} = get_default()),
+    g_settings_schema_source_new_from_directory, errthrow)
 
   //Note this doesn't need refreturn because the C function returns a reference.
   //- it is documented as transfer:full
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 7589cc58..cfddc891 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -307,7 +307,7 @@ _CONVERSION(`GSettingsSchema*',`Glib::RefPtr<SettingsSchema>',`Glib::wrap($3)')
 _CONVERSION(`GSettingsSchema*',`Glib::RefPtr<const SettingsSchema>',`Glib::wrap($3)')
 
 _CONVERSION(`GSettingsSchemaSource*',`Glib::RefPtr<SettingsSchemaSource>',`Glib::wrap($3)')
-
+_CONVERSION(`const Glib::RefPtr<SettingsSchemaSource>&',`GSettingsSchemaSource*',__CONVERT_REFPTR_TO_P)
 
 #Socket
 _CONVERSION(`const Glib::RefPtr<Socket>&',`GSocket*',__CONVERT_CONST_REFPTR_TO_P)


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