[glib/gobject-speedups: 20/28] Move deprecation warnings to object_set_property
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gobject-speedups: 20/28] Move deprecation warnings to object_set_property
- Date: Mon, 23 May 2022 17:30:22 +0000 (UTC)
commit 8d9cc8ee0ee2de73338d22c8558808a29795d117
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 14 23:26:58 2022 -0400
Move deprecation warnings to object_set_property
A small reorg that reduces the code and matches
what we do for object_get_property.
gobject/gobject.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index a7c6378dca..344a9d731e 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1590,6 +1590,8 @@ object_set_property (GObject *object,
if (redirect)
pspec = redirect;
+ consider_issuing_property_deprecation_warning (pspec);
+
/* provide a copy to work from, convert (if necessary) and validate */
g_value_init (&tmp_value, pspec->value_type);
if (!g_value_transform (value, &tmp_value))
@@ -2006,10 +2008,7 @@ g_object_new_with_custom_constructor (GObjectClass *class,
/* set remaining properties */
for (i = 0; i < n_params; i++)
if (!(params[i].pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
- {
- consider_issuing_property_deprecation_warning (params[i].pspec);
- object_set_property (object, params[i].pspec, params[i].value, nqueue);
- }
+ object_set_property (object, params[i].pspec, params[i].value, nqueue);
/* If nqueue is non-NULL then we are frozen. Thaw it. */
if (nqueue)
@@ -2057,7 +2056,6 @@ g_object_new_internal (GObjectClass *class,
for (j = 0; j < n_params; j++)
if (params[j].pspec == pspec)
{
- consider_issuing_property_deprecation_warning (pspec);
value = params[j].value;
break;
}
@@ -2083,10 +2081,7 @@ g_object_new_internal (GObjectClass *class,
*/
for (i = 0; i < n_params; i++)
if (!(params[i].pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
- {
- consider_issuing_property_deprecation_warning (params[i].pspec);
- object_set_property (object, params[i].pspec, params[i].value, nqueue);
- }
+ object_set_property (object, params[i].pspec, params[i].value, nqueue);
g_object_notify_queue_thaw (object, nqueue);
}
@@ -2504,7 +2499,6 @@ g_object_setv (GObject *object,
if (!g_object_set_is_valid_property (object, pspec, names[i]))
break;
- consider_issuing_property_deprecation_warning (pspec);
object_set_property (object, pspec, &values[i], nqueue);
}
@@ -2559,7 +2553,6 @@ g_object_set_valist (GObject *object,
break;
}
- consider_issuing_property_deprecation_warning (pspec);
object_set_property (object, pspec, &value, nqueue);
/* We open-code g_value_unset() here to avoid the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]