Vala bindings for libappindicator are incorrect

Bug #632996 reported by Maia Everett
34
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Application Indicators
Fix Released
Medium
Unassigned
indicator-application (Ubuntu)
Fix Released
Low
Ted Gould

Bug Description

Binary package hint: indicator-application

There are several issues:
1. Private fields are exposed.
2. The C prefix for AppIndicator is set incorrectly, resulting in the generated C file failing to compile because it expects the prefix to be app_indicator_app_indicator_*.
3. Some properties are not marked as being accessed directly, while the icon_name property is not bound to the existing getter/setter. The Vala compiler expects there to be _get_icon_name and _set_icon_name by default.

I'm attaching a patch for the generated .vapi file - I tweaked it for a personal project. You'll have to modify the C source, presumably.

Tags: patch
Revision history for this message
Maia Everett (linneris) wrote :
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

It's a direct result of libindicator not following GObject naming conventions and various oddities in the API itself - because of that GObject Introspection creates bogus .gir (and probably .typelib) and vapigen creates wrong bindings. To fix that we would have to rewrite big parts of API or wait for vapigen to support .metadata for .gir files - not even sure if that's in plans, by definition gir should provide all the data needed for languages to create their own bindings.

Changed in indicator-application (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in indicator-application (Ubuntu):
assignee: nobody → Ted Gould (ted)
tags: added: patch
Revision history for this message
Ted Gould (ted) wrote :

I played with this some more to see if we can trick the GIR files to handle it correctly. What is needed is for the GIR file to have a NULL namespace. This works, at some level, but the tools start to error out with it. I think that the upstream tools will have to be fixed to make this work correctly.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ted, should the patch be removed from the review list then or is it still useful?

Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 632996] Re: Vala bindings for libappindicator are incorrect

On Wed, 2010-09-29 at 09:50 +0000, Sebastien Bacher wrote:
> Ted, should the patch be removed from the review list then or is it
> still useful?

Yeah, I think so. The problem with the patch is that it breaks the Vala
API but doesn't fix it entirely. It seems that if we're going to break
everyone it should be once, to the right situation. To do that we're
going to need to fix the gobject-introspection parser, which I think we
should do for Natty. I'll subscribe this bug to the list of proposed
things we need to fix for Natty.

Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, unsbuscribing the reviewers, we should work with upstream to fix gobject-introspection though

Ted Gould (ted)
Changed in indicator-application:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This was fixed in 0.2.90

Changed in indicator-application:
status: Triaged → Fix Released
Changed in indicator-application (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.