Can't inherit from AppIndicator.Indicator in Vala

Bug #1065310 reported by Robert Ancell
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libappindicator
Fix Committed
Undecided
Unassigned
libappindicator (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

You can't inherit from AppIndicator.Indicator in Vala as it generates invalid C code:

indicator-bluetooth.c: In function ‘bluetooth_indicator_get_type’:
indicator-bluetooth.c:989:57: error: ‘APP_TYPE_INDICATOR’ undeclared (first use in this function)
indicator-bluetooth.c:989:57: note: each undeclared identifier is reported only once for each function it appears in

This is because this define is named APP_INDICATOR_TYPE in the libappindicator header files.

You can solve this by adding the type_id to the .vapi, i.e:

[CCode (cheader_filename = "libappindicator/app-indicator.h", type_check_function = "IS_APP_INDICATOR", type_id = "app_indicator_get_type ()")]

Other .vapis do this (e.g. telepathy-glib) but I can't work out how to make vapigen add these for libappIndicator.

Related branches

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Fix is in lp:~robert-ancell/libappindicator/lp-1065310 and I've confirmed it works with a local patched package.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Note that nemequ from #vala says:
"if you don't care about < 0.18 you could probably just get rid of that file"
meaning the custom file. So should be droppable at some point.

Lars Karlitski (larsu)
Changed in libappindicator:
milestone: none → 12.10.1
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 12.10.1daily13.02.13-0ubuntu1

---------------
libappindicator (12.10.1daily13.02.13-0ubuntu1) raring; urgency=low

  [ Mathieu Trudel-Lapierre ]
  * debian/control:
    - Update style: use trailing commas at the end of dependency lists.
    - Reorganize Build-Depends for clarity.
    - Bump Build-Depends on debhelper to (>= 9).
    - Drop Build-Depends on cdbs.
    - Drop old Conflicts, Replaces, Provides for old unsupported upgrade paths.
    - Update Vcs-Bzr, Vcs-Browser and add a notice to uploaders.
    - Add a Pre-Depends on multiarch-support for libappindicator(3-)7.
    - Add xvfb to Build-Depends.
  * debian/compat: bump to compat level 9.
  * debian/rules:
    - Convert from cdbs to debhelper 9.
    - Add and export DPKG_GENSYMBOLS_CHECK_LEVEL.
    - Override dh_autoreconf to run autogen.sh and not call configure.
    - Override dh_auto_test to run tests per-flavor.
  * debian/*.install:
    - Update paths for multiarch and for use with dh9 (remove debian/tmp...)
  * Fix gtkdoc tests and building of the documentation given a separate build
    directory.

  [ Chris J Arges ]
  * acinclude.m4: Fix python multi-arch include issues.

  [ Mathieu Trudel-Lapierre ]
  * Automatic snapshot from revision 245 (bootstrap):
    - Fix Vala classes not being able to inherit from Indicator (LP: #1065310)

  [ Charles Kerr ]
  * indicators call deprecated glib function g_type_init() (LP:
    #1103087)
  * test-libappindicator-status fails with "Toggle count: 99" (LP:
    #1109128)
  * Coverity COPY_PASTE_ERROR - CID 10969 (LP: #1102595)
  * libappindicator-docs.sgml missing links (LP: #1083425)
  * Coverity INTEGER_OVERFLOW - CID 10970 (LP: #1102589)

  [ Charles Kerr <email address hidden>, Mathieu Trudel-Lapierre <email address hidden>, Michael Terry ]
  * indicators call deprecated glib function g_type_init() (LP:
    #1103087)
  * test-libappindicator-status fails with "Toggle count: 99" (LP:
    #1109128)
  * Coverity INTEGER_OVERFLOW - CID 10970 (LP: #1102589)
  * Coverity COPY_PASTE_ERROR - CID 10969 (LP: #1102595)

  [ Mathieu Trudel-Lapierre ]
  * Can't inherit from AppIndicator.Indicator in Vala (LP: #1065310)

  [ Automatic PS uploader ]
  * Automatic snapshot from revision 250
 -- Automatic PS uploader <email address hidden> Wed, 13 Feb 2013 02:02:41 +0000

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

Other bug subscribers

Remote bug watches

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