Re: [Vala] interface properties: unexistent accessor



On Mon, Nov 17, 2008 at 11:35 AM, Ildar Mulyukov
<ildar users sourceforge net> wrote:
I discovered the problem (and created this simple test case). The root
of it is that the unexistent accessor referenced from the implementor class.
Maybe it's better not to do it?

Which vala build is it? (I've just pushed r2023 with a lot of fixes to
Sisyphus).

Discussed with Ildar. Apparently, main problem is that he has interface
definition and a class that implements interface in separate vala source
files. During generation phase valac puts ns1_interface1_set_name() into one
.c file and marks it as static. Therefore it is not accessible from the
second .c file where ns1_class1_set_property() is defined.

In such cases _set_property() functions generated by
gobject/valaobjectmodule.vala:add_set_property_function() need to have
indirected calls via ns1_class_real_set_name(), not
ns1_interface1_set_name() function.

Experimental patch attached.

Your speed is awesome!
But are you sure it would work when an interface would be in a library and
the class will link to this library? I'm not sure about this.
As this patch doesn't rely on internals of interface it works fine
with externally provided interfaces. I tested that with AsyncResult
from gio-2.0.vapi.
-- 
/ Alexander Bokovoy



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