KActionCollection patch

Sebastian Sauer mail at dipe.org
Sun Feb 4 15:48:03 GMT 2007


Simon Hausmann wrote:

> On Sunday 04 February 2007 03:38:45 Sebastian Sauer wrote:
>> Hi *,
>>
>> KActionCollection::actions() returns a random sorted list of
>> QList<KAction*>. I suggest following patch to preserve the order. Ok to
>> commit?
> 
> 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.

> I'd be fine with 
> making actions() return actionByName.values() though to return the actions
> sorted by the name in ascending order.

Even if it does not provide what I need it's at least better then returning 
them in arbitrarily ordered like now :)

-- 
Sebastian Sauer aka dipesh[sebsauer]
http://www.dipe.org/public_key.asc
Fingerprint: 8F1E 219B 16E6 4EC7 29CC F408 E193 65E2 9134 2221
Coder in http://www.koffice.org && http://www.kmldonkey.org




More information about the kde-core-devel mailing list