RFC: shortText -> iconText in XMLGUI

Christoph Feck christoph at maxiom.de
Sun Aug 9 14:42:10 BST 2009


While looking at bug 201346 ("Allow to edit labels in toolbars"), I stumbled 
upon a feature in XMLGUI designed to solve the problem of long icon texts: 
There is an attribute "shortText" for Action items.

Unfortunately, QAction in Qt4 uses "iconText", and I noticed that manually 
adding this attribute to an Action in a ui.rc file indeed works as expected 
(while "shortText" does not). This would mean, however, that such files would 
not pass any automatic XML verification, because both the .dtd and the .xsd 
do not have the "iconText" attribute.

There are three options, and I want feedback about them:

1) Simply replace "shortText" with "iconText" in the .dtd and .xsd. The 
attribute never worked anyway. The downside would be if existing ui.rc files 
used this attribute, they would fail to verify now, but this would actually 
make developers aware of the problem. This is the option I would prefer.

2) Handle "shortText" in the XML parser and have it convert to QAction's 
iconText attribute inside the code. The downside would be that it requires 
code changes, and would not work e.g. with current KDE 4.3.0.

3) Add "iconText" attribute and deprecate "shortText". This is the option I 
dislike most, because two attributes where only one works does not make 
sense, except that existing files continue to verify.

I attached the patch for option 1)

Christoph Feck (kdepepo)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlgui.diff
Type: text/x-diff
Size: 2213 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090809/bb19fe63/attachment.diff>

More information about the kde-core-devel mailing list