[Kde-pim] Shortcomings of StandardActionManager?

Christian Mollekopf chrigi_1 at fastmail.fm
Tue Mar 1 10:25:30 GMT 2011


Hi,

Im trying to implement StandardActions for the akonadi trash handling.
Ideally I would add the following actions to the menu:

If not in trash:
-Action: Move To Trash

If in trash:
-Action: Restore from Trash
-Action: Delete

I doesn't seem to be possible however to implement this in the StandartActions 
framework....

First, I can't change the Action text. If I want the same action for move to 
trash and restore from trash, I would have to dynamically change the text.
If I can't do this,  the user app has to manually check if the item is in 
trash or not and insert the correct action, which renders the StandartAction 
essentially useless.

Second, I can't dynamically add/remove actions, but only enable disable them.
In Trash you should have two options: Definitely delete the item, or restore 
it. If the item is not in trash, this is not necessarily the case. It should 
be up to the user app to offer a delete option if desired.

Third, It is somewhat complicated to offer options which work for items and 
collections. I don't really get why the delete item and the delete collection 
actions exist and there isn't a delete entity action. I don't see any reason 
not to implement a single action, except that it is not possible currently to 
dynamically change the text as mentioned in point one. 

So, should I just extend the StandardActionManager internally? 

I don't know if it is even possible that a single action definition in the 
kxmlmenu expands to several actions, but at least that the same action has 
several different texts should be doable, although this will further complicate 
the whole class as I don't think I can integrate it in the existing functions.

Just checking if I'm missing something here =)
Maybe there is a reason that it was implemented that way.

Cheers,

Chris
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list