GNOME Bugzilla – Bug 658006
Implementing interface properties with NoAccessorMethod
Last modified: 2011-11-07 09:30:07 UTC
Hello, lately gobject-based libraries use abstract properties in interfaces without accessors, but with wrapper methods to g_object_get/set. Currently vala always set the class vfunc when implementing the property, therefore it's an error as the class vfunc does not exist. Such a case can be found in clutter interfaces and mx interfaces. My use case is implementing the Mx.Scrollable interface that has the horizontal-adjustment and vertical-adjustment abstract properties marked with NoAccessorMethod. Attaching series of two patches that fix the problem.
Created attachment 195437 [details] [review] codegen: Do not set accessor vfunc for NoAccessorMethod properties Partially fixes bug 658006.
Created attachment 195438 [details] [review] codegen: Use real_get/set_* functions as helpers for NoAccessorMethod props If the base property has no accessors the class->vfunc are not defined so we can only use our accessors. With this commit we exploit the already defined real_get and real_set functions. Fixes bug 658006.
commit 074317976b885c2e72de010e227caf07d3dde7f4 Author: Luca Bruno <lucabru@src.gnome.org> Date: Thu Sep 1 16:59:52 2011 +0200 codegen: Use real_get/set_* functions as helpers for NoAccessorMethod props If the base property has no accessors the class->vfunc are not defined so we can only use our accessors. With this commit we exploit the already defined real_get and real_set functions. Fixes bug 658006. commit 7e22d9f8237f29a98cf0648a628ae1841f23b3c2 Author: Luca Bruno <lucabru@src.gnome.org> Date: Thu Sep 1 16:43:48 2011 +0200 codegen: Do not set accessor vfunc for NoAccessorMethod properties Partially fixes bug 658006. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Any chance that these fixes will be applied to the stable 0.14 branch?
Seconded: Totem needs these fixes for bug #662148.