From df5aa217e4aca44059a21902e72c8a60ea0f651d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 26 Feb 2024 13:47:36 +0000 Subject: [PATCH] =?UTF-8?q?gobject:=20Don=E2=80=99t=20warn=20when=20settin?= =?UTF-8?q?g=20deprecated=20construct=20property=20defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default values for construct properties always have to be set, even if those properties are deprecated. The code to do that is in GLib, and not under the control of the user (unless they completely override the `constructor` vfunc, which is not recommended). So don’t emit a warning for that if `G_ENABLE_DIAGNOSTICS` is enabled. In particular, this fixes deprecation warnings being emitted for properties of a parent class when chaining up with a custom constructor, even when none of the child class code mentions the deprecated property. Signed-off-by: Philip Withnall Fixes: #3254 --- gobject/gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gobject/gobject.c b/gobject/gobject.c index 5a5b1cdc1..111d401b8 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -2992,7 +2992,7 @@ g_object_constructor (GType type, GParamSpec *pspec = construct_params->pspec; construct_params++; - object_set_property (object, pspec, value, nqueue, TRUE); + object_set_property (object, pspec, value, nqueue, FALSE); } g_object_notify_queue_thaw (object, nqueue, FALSE); /* the notification queue is still frozen from g_object_init(), so