Bug 26211 - Generate constants for namespaced contact attributes
Summary: Generate constants for namespaced contact attributes
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: high major
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-01-25 07:05 UTC by Simon McVittie
Modified: 2010-04-30 06:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2010-01-25 07:05:25 UTC
Bug #26210 demonstrates that we should generate string constants for well-known contact attributes (and also capability tokens). I propose TP_TOKEN_${interface}_${token}, like TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES.
Comment 1 Cosimo Alfarano 2010-04-19 05:42:26 UTC
Please review the TP_TOKEN_* constant generation.

It ignores "is-family=yes" for tp:hct.

It also replaces "-" and "." with "_" for both "tp:hct" and "contact-attribute" elements' constants.

C.
Comment 2 Simon McVittie 2010-04-19 06:17:31 UTC
Looks good so far, but all the #defines that result from this ought to be in the documentation (docs/reference/*sections.txt).
Comment 3 Cosimo Alfarano 2010-04-20 07:34:17 UTC
Added manually, this means that every token added in spec will have to be added in docs/reference/*sections.txt even though it's automatically recognized by tool/glib-interfaces-gen.py.

It it's right, the branch is updated.
Comment 4 Simon McVittie 2010-04-20 08:12:23 UTC
Fixed in 0.11.3
Comment 5 Simon McVittie 2010-04-30 04:59:11 UTC
Actually, these constants are wrong in 0.11.3 and 0.11.4; they have a dot in, whereas we want a slash.

I blame the reviewer (some guy called Simon...), who should have spotted this, and should also have insisted on a regression test.

Here's a branch fixing this:
http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/tokens
Comment 6 Simon McVittie 2010-04-30 05:01:51 UTC
This could break people quite badly when doing the recommended thing, so major/high.
Comment 7 Jonny Lamb 2010-04-30 05:34:07 UTC
Not sure if I'm a tp-glib reviewer, but review+.
Comment 8 Simon McVittie 2010-04-30 06:40:58 UTC
(In reply to comment #7)
> Not sure if I'm a tp-glib reviewer, but review+.

I think you qualify :-)

Thanks, fixed in git for 0.11.5.


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.