After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658006 - Implementing interface properties with NoAccessorMethod
Implementing interface properties with NoAccessorMethod
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GType
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 660361
 
 
Reported: 2011-09-01 20:06 UTC by Luca Bruno
Modified: 2011-11-07 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: Do not set accessor vfunc for NoAccessorMethod properties (4.17 KB, patch)
2011-09-01 20:08 UTC, Luca Bruno
none Details | Review
codegen: Use real_get/set_* functions as helpers for NoAccessorMethod props (3.16 KB, patch)
2011-09-01 20:09 UTC, Luca Bruno
none Details | Review

Description Luca Bruno 2011-09-01 20:06:09 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.
Comment 1 Luca Bruno 2011-09-01 20:08:45 UTC
Created attachment 195437 [details] [review]
codegen: Do not set accessor vfunc for NoAccessorMethod properties

Partially fixes bug 658006.
Comment 2 Luca Bruno 2011-09-01 20:09:00 UTC
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.
Comment 3 Luca Bruno 2011-09-29 20:36:50 UTC
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.
Comment 4 Gert Kulyk 2011-11-06 19:16:39 UTC
Any chance that these fixes will be applied to the stable 0.14 branch?
Comment 5 Philip Withnall 2011-11-07 09:30:07 UTC
Seconded: Totem needs these fixes for bug #662148.