Bug 31473

Summary: Adjust the g-i namespace for tp-glib to "TelepathyGLib"
Product: Telepathy Reporter: Travis Reitter <travis.reitter>
Component: tp-glibAssignee: Travis Reitter <travis.reitter>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/treitter/telepathy-glib.git;a=shortlog;h=refs/heads/fdo31473-vala-0.11.x
Whiteboard: review+
i915 platform: i915 features:

Description Travis Reitter 2010-11-08 08:46:59 UTC
The g-i bindings (and their users) all use the namespace "TelepathyGLib" already.

A recent change to Vala "fixes" the way it creates a namespace from the GIR file. This is more consistent with the way Vala uses the C namespace, but is inconsistent with our existing bindings.

The trivial work-around should not impact the namespace of the other g-i bindings.
Comment 1 Travis Reitter 2010-11-08 09:08:29 UTC
This trivial branch fixes the issue:

http://git.collabora.co.uk/?p=user/treitter/telepathy-glib.git;a=shortlog;h=refs/heads/fdo31473-vala-0.11.x

This works fine with both Vala 0.10.0 and git master (which will become 0.11.2).
Comment 2 Simon McVittie 2010-11-08 09:28:36 UTC
Does this file need to be installed, or is it enough to have it next to the .gir when vapigen is run?

You say "fixes". Is our .gir file wrong? Is Vala wrong? Is this going to need "fixing" repeatedly?
Comment 3 Travis Reitter 2010-11-08 09:58:00 UTC
(In reply to comment #2)
> Does this file need to be installed, or is it enough to have it next to the
> .gir when vapigen is run?
> 
> You say "fixes". Is our .gir file wrong? Is Vala wrong? Is this going to need
> "fixing" repeatedly?

No, the metadata file doesn't need to be installed. It's just for making binding-generation-time adjustments. (If there are suddenly other g-i bindings for tp-glib that we don't include in our source tree, we can install it, but I don't see that ever happening).

Our GIR file is fine. Vala's convention is to just use the C namespace for Vala bindings. So, way back when, I was using the namespace "Tp" for our Vala bindings. Then I switched it to "TelepathyGLib" for consistency, and now Vala's caught up vapigen (operating on GIR) to the same convention as vapigen (operating on GIDL).

To avoid breaking compatibility, this metadata file keeps the Vala bindings' namespace as "TelepathyGLib".

Since this just catches up to existing Vala convention, this shouldn't change in the future.
Comment 4 Travis Reitter 2010-11-08 10:18:39 UTC
Cherry-picked into telepathy-glib-0.12, then merged that into master.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.