Re: Default values for properties



Martin Baulig <martin home-of-linux org> writes: 
> While doing some debugging, I realized that on object creation the
> `set_property()' method is called for all properties and not only for the
> ones that were given to g_object_new().

By "all properties" I hope you mean "all construct properties" or we
have a serious efficiency issue. ;-)

> This means that my `set_property()' handler can't figure out whether the
> user explicitly set a property or whether it's just the default value of it.
> 
> What do you think about adding a G_PARAM_NODEFAULT flag to request that a
> property won't get its default value if it isn't explicitly set ?
> 

Why are construct properties different from regular properties in this
respect? i.e. why are we setting them to their default value at all?

Normal properties have their defaults filled in _init(), construct
properties could work the same way.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]