mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
Avoid overeager warning about deprecated properties
Construct properties are always set during construction. It makes no sense to warn about this even if the property is marked as deprecated; the deprecation warning should only be issues for explicit uses of the property after construction. https://bugzilla.gnome.org/show_bug.cgi?id=730045
This commit is contained in:
parent
4dba2eb486
commit
4360756c69
@ -1348,10 +1348,17 @@ object_set_property (GObject *object,
|
|||||||
if (enable_diagnostic[0] == '1')
|
if (enable_diagnostic[0] == '1')
|
||||||
{
|
{
|
||||||
if (pspec->flags & G_PARAM_DEPRECATED)
|
if (pspec->flags & G_PARAM_DEPRECATED)
|
||||||
|
{
|
||||||
|
/* 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 "
|
g_warning ("The property %s:%s is deprecated and shouldn't be used "
|
||||||
"anymore. It will be removed in a future version.",
|
"anymore. It will be removed in a future version.",
|
||||||
G_OBJECT_TYPE_NAME (object), pspec->name);
|
G_OBJECT_TYPE_NAME (object), pspec->name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* provide a copy to work from, convert (if necessary) and validate */
|
/* provide a copy to work from, convert (if necessary) and validate */
|
||||||
g_value_init (&tmp_value, pspec->value_type);
|
g_value_init (&tmp_value, pspec->value_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user