[glibmm] Settings: Fix the build with the latest glib from git master.



commit bd4605744783c18e43c74d29a9a691d638307975
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Jun 6 14:17:03 2010 +0200

    Settings: Fix the build with the latest glib from git master.
    
    * gio/src/gio_methods.defs: Remove extra length parameters, removed from the
    C API. This is a generated file, but this change is simple.
    * gio/src/settings.[hg|ccg]: get_string_array(), set_string_array():
    Remove the length parameter, and just use _WRAP_METHOD() now that it is simple
    enough for that.
    * tools/m4/convert_gio.m4: Add a necessary conversion.
    * glib/src/glib_functions.defs: Remove some bad unused definitions that
    were causing annoying warnings.

 gio/src/gio_methods.defs     |    2 --
 gio/src/settings.ccg         |   14 --------------
 gio/src/settings.hg          |   29 +++--------------------------
 glib/src/glib_functions.defs |   16 ++++------------
 tools/m4/convert_gio.m4      |    1 +
 5 files changed, 8 insertions(+), 54 deletions(-)
---
diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs
index 4e4a6be..d407f00 100644
--- a/gio/src/gio_methods.defs
+++ b/gio/src/gio_methods.defs
@@ -6601,7 +6601,6 @@
   (return-type "gchar**")
   (parameters
     '("const-gchar*" "key")
-    '("gsize*" "length")
   )
 )
 
@@ -6612,7 +6611,6 @@
   (parameters
     '("const-gchar*" "key")
     '("const-gchar*-const*" "value")
-    '("gssize" "length")
   )
 )
 
diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg
index 479bfc0..6fceed5 100644
--- a/gio/src/settings.ccg
+++ b/gio/src/settings.ccg
@@ -9,20 +9,6 @@ Glib::RefPtr<Settings> Settings::create_with_context(const Glib::ustring& schema
     return Glib::RefPtr<Settings>(new Settings(g_settings_new_with_context(schema.c_str(), context.c_str())));
 }
 
-Glib::ArrayHandle<Glib::ustring>
-  Settings::get_string_array(const Glib::ustring& key) const
-{
-  gchar** result = g_settings_get_strv(const_cast<GSettings*>(gobj()),
-    key.c_str());
-  return Glib::ArrayHandle<Glib::ustring>(result, Glib::OWNERSHIP_DEEP);
-}
-
-bool Settings::set_string_array(const Glib::ustring& key,
-  const Glib::ArrayHandle<Glib::ustring>& value)
-{
-  return g_settings_set_strv(gobj(), key.c_str(), value.data());
-}
-
 void Settings::bind(const Glib::ustring& key,
                     const Glib::PropertyProxy_Base& property_proxy,
                     SettingsBindFlags flags)
diff --git a/gio/src/settings.hg b/gio/src/settings.hg
index 5d8c6f4..e6a61e5 100644
--- a/gio/src/settings.hg
+++ b/gio/src/settings.hg
@@ -60,33 +60,10 @@ public:
   _WRAP_METHOD(double get_double(const Glib::ustring& key) const, g_settings_get_double)
   _WRAP_METHOD(void set_double(const Glib::ustring& key, double value), g_settings_set_double)
 
-  /** Gets the value that is stored at key in the settings.
-   * It is a programmer error to pass a @a key that isn't valid for settings
-   * or is not of type 'string array'.
-   *
-   * @param key The key to get the value for.
-   * @return a newly-allocated, <tt>0</tt>-terminated array of strings.
-   *
-   * @newin{2,26}
-   */
-  Glib::ArrayHandle<Glib::ustring>
-    get_string_array(const Glib::ustring& key) const;
-  _IGNORE(g_settings_get_strv)
-
-  /** Sets @a key in the settings to @a value.
-   * It is a programmer error to pass a @a key  that isn't valid for settings
-   * or is not of type 'string array'.
-   *
-   * @param key The name of the key to set.
-   * @param value The value to set it to.
-   * @return <tt>true</tt> if setting the key succeeded, <tt>false</tt> if the
-   * key was not writable.
-   *
-   * @newin{2,26}
-   */
-  bool set_string_array(const Glib::ustring& key,
-    const Glib::ArrayHandle<Glib::ustring>& value);
-  _IGNORE(g_settings_set_strv)
+  #m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
+  _WRAP_METHOD(Glib::StringArrayHandle get_string_array(const Glib::ustring& key) const, g_settings_get_strv)
+
+  _WRAP_METHOD(bool set_string_array(const Glib::ustring& key,  const Glib::StringArrayHandle& value), g_settings_set_strv)
 
   // Ignore varargs functions.
   _IGNORE(g_settings_get, g_settings_set)
diff --git a/glib/src/glib_functions.defs b/glib/src/glib_functions.defs
index 723f530..c8ba98c 100644
--- a/glib/src/glib_functions.defs
+++ b/glib/src/glib_functions.defs
@@ -9632,7 +9632,7 @@
   (return-type "none")
   (parameters
     '("const-char*" "testpath")
-    '("void-(*" "test_func")
+    '("somefunc" "test_func")
   )
 )
 
@@ -9642,7 +9642,7 @@
   (parameters
     '("const-char*" "testpath")
     '("gconstpointer" "test_data")
-    '("void-(*" "test_func")
+    '("somefunc" "test_func")
   )
 )
 
@@ -9757,7 +9757,7 @@
     '("const-char*" "test_name")
     '("gsize" "data_size")
     '("gconstpointer" "test_data")
-    '("void-(*" "data_setup")
+    '("somefunc" "data_setup")
   )
 )
 
@@ -9890,7 +9890,7 @@
     '("const-char*" "testpath")
     '("gsize" "data_size")
     '("gconstpointer" "test_data")
-    '("void-(*" "data_setup")
+    '("somefunc" "data_setup")
   )
 )
 
@@ -11266,14 +11266,6 @@
   )
 )
 
-(define-function atexit
-  (c-name "atexit")
-  (return-type "int")
-  (parameters
-    '("void" "(*")
-  )
-)
-
 (define-function g_find_program_in_path
   (c-name "g_find_program_in_path")
   (return-type "gchar*")
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index c8a600c..78542ac 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -127,6 +127,7 @@ _CONVERSION(`const Glib::RefPtr<OutputStream>&',`GOutputStream*',__CONVERT_CONST
 
 #Settings
 _CONVERSION(`GSettings*',`Glib::RefPtr<Settings>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::StringArrayHandle&',`const gchar*-const*',`($3).data()')
 
 #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]