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.

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.

Regards,
Roman

Attachment: statusmanagerfinal13.diff.bz2
Description: application/bzip2

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

Reply via email to