GNOME Bugzilla – Bug 746057
Master doesn't build with Vala 0.24
Last modified: 2015-03-12 01:34:04 UTC
The latest master doesn't build with Vala 0.24 due to these errors: /home/yorba/geary/src/client/components/main-toolbar.vala:195.9-195.35: error: The name `unbind' does not exist in the context of `GLib.Binding' guest_header_binding.unbind(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ /home/yorba/geary/src/client/composer/composer-box.vala:81.13-81.32: error: The name `unbind' does not exist in the context of `GLib.Binding?' title_binding.unbind(); ^^^^^^^^^^^^^^^^^^^^ Since these are small errors, I think we should change them to work with Vala 0.24. The unref() method is acceptable here, I believe (see bug #730967). Or, extern g_binding_unbind() and call it directly. The alternative is to require Vala 0.26, but that's not available out-of-the-box on Utopic, which we're tracking for this release.
Created attachment 299142 [details] [review] Call g_binding_unbind directly, since it isn't bound for Vala < 0.26 I went with the extern route, since that makes it more obvious that this is a workaround. I stuck the function in GtkUtil, for lack of a better place. This seems to compile under both Vala 0.24 and 0.26, but I've never used extern before, so please check.
Review of attachment 299142 [details] [review]: This looks fine. In fact, you went the extra mile and made it "look" like Vala w/ the CCode attribute. You can also just do this with extern: extern void g_bind_unbind(Binding binding); and then call the function directly: g_bind_unbind(title_binding); It's six-of-one, so your patch is fine.
I tried to do it like that, but it didn't work with it in the GtkUtil namespace. I figured putting it in the namespace would help the sorry soul who stumbles on this next figure out what we were doing. Attachment 299142 [details] pushed as bfaeee6 - Call g_binding_unbind directly, since it isn't bound for Vala < 0.26