GNOME Bugzilla – Bug 666615
loosen property override flag restrictions
Last modified: 2011-12-20 19:58:55 UTC
This change is controversial, so review is appreciated.
Created attachment 203979 [details] [review] gobject: loosen property override flag restrictions GObject enforces the following restrictions on property overrides: - must only add abilities: if the parent class supports readability/writability then the subclass must also support them. Subclasses are free to add readability/writability. - must not add additional restrictions: if the parent class doesn't have construct/construct-only restrictions then the subclass must not add them. Subclasses are free to remove restrictions. The problem with the previous implementation is that the check against adding construct/construct-only restrictions was being done even if the property was not previously writable. As an example: "readable" and "writable only on construct" was considered as being more restrictive than "read only". This patch tweaks the check to allow the addition of construct/construct-only restrictions for properties that were previously read-only and are now being made writable.
Created attachment 203980 [details] [review] GAction: back out changes to property flags 41e5ba86a791a17bb560dd7813ad7e849e0230dc introduced some changes to the property flags of GAction. These changes were not a reflection of the actual interface of GAction but were necessary due to GObject being overly-sensitive to flag changes on property overrides. Now that the GObject bug is fixed, we can restore the GAction flags to their correct values.
Review of attachment 203979 [details] [review]: No objections to this. I was not following the irc discussion closely enough, it seems.
Review of attachment 203979 [details] [review]: The commit message is excellent. Following the logic in the implementation is a little awkward with deeply nested negations and && and || mixed with bit logic |. Maybe split it out like: if (class_pspec) { if (pspecs[n]->flags & WRITABLE) { if (!SUBSET()) { error } } if (!SUBSET()) { error } } ?
Attachment 203979 [details] pushed as af24dbc - gobject: loosen property override flag restrictions Attachment 203980 [details] pushed as ebf572c - GAction: back out changes to property flags