From 4e793c2eefab1a9b5b0c29b530cbe77fb53d7396 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 20 Dec 2011 19:33:02 -0500 Subject: GObject: allow G_PARAM_CONSTRUCT on any override We were previously preventing implementations of an interface from specifying G_PARAM_CONSTRUCT for a property of that interface if the interface didn't specify it itself (or was readonly). This is something that should only interest the implementation, so we remove this restriction. This allows 6 new possible override scenarios: - writable -> writable/construct - writable -> readwrite/construct - readwrite -> readwrite/construct - writable/construct-only -> writable/construct - writable/construct-only -> readwrite/construct - readwrite/construct-only -> readwrite/construct and we update the testcase to reflect this. https://bugzilla.gnome.org/show_bug.cgi?id=666616 --- gobject/gobject.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gobject/gobject.c') diff --git a/gobject/gobject.c b/gobject/gobject.c index ffbc3bbc5..b0fe21837 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1407,13 +1407,10 @@ object_interface_check_properties (gpointer func_data, * If the interface was not writable to begin with then we don't * really have any problems here because "writable at construct * type only" is still more permissive than "read only". - * - * It's questionable if we should have G_PARAM_CONSTRUCT checked - * here.... */ if (pspecs[n]->flags & G_PARAM_WRITABLE) { - if (!SUBSET (class_pspec->flags, pspecs[n]->flags, G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)) + if (!SUBSET (class_pspec->flags, pspecs[n]->flags, G_PARAM_CONSTRUCT_ONLY)) { g_critical ("Flags for property '%s' on class '%s' introduce additional restrictions on " "writability compared with the property on interface '%s'\n", pspecs[n]->name, -- cgit v1.2.1