[Bug 24897] asses what to do about profiles

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Aug 24 10:01:29 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=24897

--- Comment #7 from Olli Salli <ollisal at gmail.com> 2010-08-24 01:01:29 PDT ---
Mikhail Zabaluev suggested the following, which I think is a good idea for the
most parts:

> Quoting the example:
> 
> <service id="google-talk"
>          xmlns="http://telepathy.freedesktop.org/wiki/service-profile-v1">
> 
>   <type>IM</type>
>   <provider>google</provider>
>   <name>GoogleTalk™</name>
>   <icon>base-name-of-icon</icon>
> 
>   <manager>gabble</manager>
>   <protocol>jabber</protocol>
> 
> Now the same reworked with an XML schema nazi attitude:
> 
> <service xmlns="http://telepathy.freedesktop.org/wiki/service-profile-according-to-mikhailz"
>          id="google-talk"
>          type="IM"
>          provider="google"
>          manager="gabble"
>          protocol="jabber">
> 
>   <name>GoogleTalk™</name>

++ for these

>   <icon base-name="base-name-of-icon" />  <!--
>      a simpler option could be file="pathname",
>      some could use stock-id="foo_bar"
>      or even uri="http://tranquility.moon/cheese.svg" -->

I think we want the same semantics, that is, the im-foo style name, for this
one as the Icon property for Accounts and in the spec 0.19.10 .manager file
additions, Protocol objects follows these semantics too. I'd think this would
~always be used with an icon loader which you can just pass the base name to,
instead of having to specify the complete path? The base name, without the file
extension, is beneficial in that we get icons from the current icon theme, in
the desired size, if there are suitable ones, be they svg or png.

> 
> Rules of thumb applied:
> 
> * A unique attribute with a simple value is, naturally, best represented by an XML attribute.
> * A value that has a strict syntax (e.g. a pathname, an URI, or a member of an established registry) is safer as an XML attribute value, where less XML fanciness is permitted to disrupt the text content.
> For instance, less potential for stupid difficulties like <type> IM <!-- is this right? --></type> interpreted differently from <type>IM</type>. This does not mean only your code, but any tools that might be applied to these files for fun and profit.
> * When value's semantics are not the most natural to serve as the unqualified content to an entity (e.g. the fact that an icon is referred by a base name with some implied transformation), make it an attribute with a name referring to the semantics.
> * Text content is generally meant for text readable by the user. So <name/> is using it rightfully.
> 
> Misha,
>   amazed at how most people make their XML unnecessarily hard to use and fragile.
> 

Fully agree :)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list