stop using deprecated API, and use activity icons

svn path=/trunk/KDE/kdebase/workspace/; revision=1192050
This commit is contained in:
Chani Armitage 2010-11-01 19:53:22 +00:00
parent 03165ff8eb
commit 0e7e1aa077
2 changed files with 8 additions and 7 deletions

View file

@ -271,7 +271,7 @@ void Workspace::clientPopupAboutToShow()
{ {
initDesktopPopup(); initDesktopPopup();
} }
QStringList act = activityController_.availableActivities(); QStringList act = openActivityList();
kDebug() << "activities:" << act.size(); kDebug() << "activities:" << act.size();
if ( act.size() < 2 ) if ( act.size() < 2 )
{ {
@ -544,15 +544,16 @@ void Workspace::activityPopupAboutToShow()
action->setChecked( true ); action->setChecked( true );
activity_popup->addSeparator(); activity_popup->addSeparator();
foreach (const QString &activity, activityController_.availableActivities()) { foreach (const QString &id, openActivityList()) {
QString name = KActivityInfo::name(activity); KActivityInfo activity(id);
QString name = activity.name();
name.replace('&', "&&"); name.replace('&', "&&");
action = activity_popup->addAction( name ); action = activity_popup->addAction( KIcon(activity.icon()), name );
action->setData( activity ); action->setData( id );
action->setCheckable( true ); action->setCheckable( true );
if ( active_popup_client && if ( active_popup_client &&
!active_popup_client->isOnAllActivities() && active_popup_client->isOnActivity(activity) ) !active_popup_client->isOnAllActivities() && active_popup_client->isOnActivity(id) )
action->setChecked( true ); action->setChecked( true );
} }
} }

View file

@ -373,7 +373,7 @@ void Workspace::init()
} }
if( !setCurrentDesktop( initial_desktop )) if( !setCurrentDesktop( initial_desktop ))
setCurrentDesktop( 1 ); setCurrentDesktop( 1 );
allActivities_ = activityController_.availableActivities(); allActivities_ = activityController_.listActivities();
updateCurrentActivity( activityController_.currentActivity() ); updateCurrentActivity( activityController_.currentActivity() );
// Now we know how many desktops we'll have, thus we initialize the positioning object // Now we know how many desktops we'll have, thus we initialize the positioning object