Le dimanche 13 janvier 2008, Roman Jarosz a écrit :
> Hi,
>
> I've managed to move StatusRootAction, StatusGroupAction, StatusAction and
> StatusEditAction from libkopete to kopete/statusmenu/ ( better dir name
> idea are welcome :) )
>
> Also I had to move createAccountStatusActions to StatusRootAction and
> changed it to static.
>
> And to be able to iterate over registered statuses in
> createAccountStatusActions I've added RegisteredStatusMap
> registeredStatusMap( Protocol *protocol ) const; to OnlineStatusManager and
> moved
>
> struct RegisteredStatusStruct
> {
>       QString caption;
>       OnlineStatusManager::Categories categories;
>       OnlineStatusManager::Options options;
> };
> typedef QMap< OnlineStatus , RegisteredStatusStruct >  RegisteredStatusMap;
> to OnlineStatusManager header file.

Another possibility would be to add theses 3 field to the OnlineStatus 
itself...  is it a good idea ?  and then return a simple list of 
OnlineStatus.



>
> Also I found another problem that some accounts don't want to have status
> menu and they bypass it in code so I've added hack that looks like this
>
> KActionMenu *menu = a->actionMenu();
> if( menu )
> {
>       QList<QAction *> actionList = menu->menu()->actions();
>       // Hack to check if we should add status actions
>       if ( actionList.count() > 1 && !actionList.at(0)->isEnabled() &&
> actionList.at(1)->isSeparator() )
> Kopete::StatusRootAction::createAccountStatusActions( a, menu,
> actionList.at(1) );
>
>       popup->addAction( menu );
> }
>
> This checks if first action in menu is title and second is separator. If
> it's true then we should add menu. The question is if I should use this
> hack or add argument to Account::actionMenu() which will indicate if we
> should or shouldn't add status menu.

This is not good.
Why would a protocol not have such status ?
Maybe it's still using the old API.  
Please don't use such hack.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to