Check for clashing ids
#1
Hi,

This seems like an obvious question but searching didn't provide any useful results.

When picking new ids for controls I have to be careful not to overlap. I might get lucky and pick one that appears to work, but maybe that's because a conditional include* didn't get called. I could grep for an id number, but that might be overkill because ids can coexist if they will never appear on the same window.

So is there a way to detect clashing ids? Perhaps this is a features request for something to be written in the log when a duplicate id is detected.

*ETA:

Can includes be made conditionally? As far as I can tell XBMC skins only have conditional visibility. So includes are called regardless. Right? Does a visible control (and its id number) take priority over an invisible one?
Reply
#2
i'm double paranoid, so i keep a list of id's i've used and use grep whenever i need new one.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
<include condition="...">Your include</include>

And yes, visible controls have prio over invisible ones (as long as they can't be focused if invisible). XBMC picks the first visible control if you have multiple controls with the same id.
Image
Reply
#4
Ah ha. It's good to know that include has a condition attribute. Out of interest do any other tags? I see <animation> does.

Also, is there a directory somewhere that contains "rendered" (or "compiled") xml?
Reply
#5
No there isn't any directory. The files will be loaded once on activation, then (afaik) cached in memory.

There are more controls which accept conditions:

onload, onunload, onleft, onright etc.

In the gotham nightlies there is also colordiffuse where you can use condtitions.
Image
Reply
#6
(2013-10-25, 17:45)powlo Wrote: When picking new ids for controls I have to be careful not to overlap. I might get lucky and pick one that appears to work, but maybe that's because a conditional include* didn't get called. I could grep for an id number, but that might be overkill because ids can coexist if they will never appear on the same window.

You can reuse IDs in different windows. You just can't have the same IDs in the same window.
My skins:

Amber
Quartz

Reply

Logout Mark Read Team Forum Stats Members Help
Check for clashing ids0