KActionCollection patch

Thomas Zander zander at kde.org
Sun Feb 4 16:54:46 GMT 2007


On Sunday 04 February 2007 16:48, Sebastian Sauer wrote:
> > For an API that emulates an associative container (string -> action) I
> > don't see the point of preserving the insertion order.
>
> Well, that may depend on how KActionCollection is used. E.g. at Kross I use
> it as container for actions and just like any list the order the actions
> are added is also the display-order. It's easy to put any other sorting
> like ascending on top (just use QSortFilterProxyModel for the QList) but
> there is no easy way to restore the insert-order.

Well, its a collection, not a list :)

I'm curious why its important for anyone to get actions out in the same way 
they went in.
And non-gui code that depends on it is broken by design.
Any gui code should just sort it based on external rules. Because you don't 
want the order in which you code things to alter the way your gui looks. At 
least, thats not what I would expect.

If plain sorting doesn't work; then I'd suggest to either create a hard coded 
list or tree in your gui (and not in an action collection since thats public 
API) or use an external file (like xmlgui does with the rc file) to structure 
the commands.
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070204/ae52dc55/attachment.sig>


More information about the kde-core-devel mailing list