summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2017-04-29 10:45:55 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2017-04-29 10:45:55 +0200
commit4ba762ab78b54811f722ce0da8b77325b6556bbd (patch)
tree5407c0604f912c7e76834ea7448a43e1307db55a
parent05d869889eb3f54d59529675aaf9036a011b7a86 (diff)
downloadglibmm-4ba762ab78b54811f722ce0da8b77325b6556bbd.tar.gz
Glib::Object: Suppress deprecation warning for g_object_newv()
g_object_newv() is deprecated in favor of g_object_new_with_properties(), which is new in glib 2.54.
-rw-r--r--glib/glibmm/object.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc
index e7f6f88f..085edf03 100644
--- a/glib/glibmm/object.cc
+++ b/glib/glibmm/object.cc
@@ -211,7 +211,7 @@ Object::Object()
object_type = object_class_.clone_custom_type(custom_type_name_, custom_interface_classes);
}
- void* const new_object = g_object_newv(object_type, 0, nullptr);
+ void* const new_object = g_object_new(object_type, nullptr);
// Connect the GObject and Glib::Object instances.
ObjectBase::initialize(static_cast<GObject*>(new_object));
@@ -247,8 +247,13 @@ Object::Object(const Glib::ConstructParams& construct_params)
// This works with custom types too, since those inherit the properties of
// their base class.
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ //TODO: Replace g_object_newv() by g_object_new_with_properties() when we can
+ // require glib 2.54. GParameter is also deprecated (only mentioned in a comment).
+ // Don't use it in ConstructParams when we can break ABI.
void* const new_object =
g_object_newv(object_type, construct_params.n_parameters, construct_params.parameters);
+ G_GNUC_END_IGNORE_DEPRECATIONS
// Connect the GObject and Glib::Object instances.
ObjectBase::initialize(static_cast<GObject*>(new_object));