[glib] gobject: Deprecate g_object_newv



commit e2c3b7f634ebce93154ea1d915ae8d65092f9bc5
Author: Fabian Orccon <cfoch fabian gmail com>
Date:   Thu Jan 26 19:54:30 2017 -0500

    gobject: Deprecate g_object_newv
    
    g_object_newv uses a GParameter as argument. Since GParameter
    is deprecated due to this type is not introspectible,
    g_object_newv is deprecated now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709865

 gobject/gobject.c |    9 ++++++---
 gobject/gobject.h |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 2b9540f..43f64d3 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1620,7 +1620,7 @@ g_object_new (GType          object_type,
   
   /* short circuit for calls supplying no properties */
   if (!first_property_name)
-    return g_object_newv (object_type, 0, NULL);
+    return g_object_new_with_properties (object_type, 0, NULL, NULL);
 
   va_start (var_args, first_property_name);
   object = g_object_new_valist (object_type, first_property_name, var_args);
@@ -1883,7 +1883,7 @@ g_object_new_is_valid_property (GType                  object_type,
 
 
 /**
- * g_object_new_with_properties:
+ * g_object_new_with_properties: (rename-to g_object_new)
  * @object_type: the object type to instantiate
  * @n_properties: the number of properties
  * @names: (array length=n_properties): the names of each property to be set
@@ -1957,7 +1957,7 @@ g_object_new_with_properties (GType          object_type,
 }
 
 /**
- * g_object_newv: (rename-to g_object_new)
+ * g_object_newv:
  * @object_type: the type id of the #GObject subtype to instantiate
  * @n_parameters: the length of the @parameters array
  * @parameters: (array length=n_parameters): an array of #GParameter
@@ -1969,6 +1969,9 @@ g_object_new_with_properties (GType          object_type,
  *
  * Returns: (type GObject.Object) (transfer full): a new instance of
  * @object_type
+ *
+ * Deprecated: 2.52: Use g_object_new_with_properties() instead.
+ * deprecated. See #GParameter for more information.
  */
 gpointer
 g_object_newv (GType       object_type,
diff --git a/gobject/gobject.h b/gobject/gobject.h
index fd2c5a8..31e0eeb 100644
--- a/gobject/gobject.h
+++ b/gobject/gobject.h
@@ -425,7 +425,7 @@ GObject*    g_object_new_with_properties      (GType           object_type,
                                                guint           n_properties,
                                                const char     *names[],
                                                const GValue    values[]);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_52_FOR(g_object_new_with_properties)
 gpointer    g_object_newv                    (GType           object_type,
                                               guint           n_parameters,
                                               GParameter     *parameters);


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