diff --git a/gobject/gobject.c b/gobject/gobject.c index e12eb6ba9..78fe203e9 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1348,9 +1348,16 @@ object_set_property (GObject *object, if (enable_diagnostic[0] == '1') { if (pspec->flags & G_PARAM_DEPRECATED) - g_warning ("The property %s:%s is deprecated and shouldn't be used " - "anymore. It will be removed in a future version.", - G_OBJECT_TYPE_NAME (object), pspec->name); + { + /* don't warn for automatically provided construct properties */ + if (!(pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)) || + !object_in_construction (object)) + { + g_warning ("The property %s:%s is deprecated and shouldn't be used " + "anymore. It will be removed in a future version.", + G_OBJECT_TYPE_NAME (object), pspec->name); + } + } } /* provide a copy to work from, convert (if necessary) and validate */