use the new API to tell which activities are open
svn path=/trunk/KDE/kdebase/workspace/; revision=1192048
This commit is contained in:
parent
f2c142e8fb
commit
54cba6fe22
2 changed files with 4 additions and 8 deletions
10
sm.cpp
10
sm.cpp
|
@ -206,7 +206,8 @@ void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds
|
|||
|
||||
void Workspace::storeActivity(const QString &id)
|
||||
{
|
||||
//TODO check if it's already closed
|
||||
QStringList openActivities = openActivityList(); //FIXME please don't deadlock
|
||||
|
||||
QSet<QByteArray> saveSessionIds;
|
||||
QSet<QByteArray> dontCloseSessionIds;
|
||||
kDebug() << id;
|
||||
|
@ -232,7 +233,7 @@ void Workspace::storeActivity(const QString &id)
|
|||
{
|
||||
if (activityId == id)
|
||||
saveSessionIds << sessionId;
|
||||
else if (openActivities_.contains(activityId))
|
||||
else if (openActivities.contains(activityId))
|
||||
dontCloseSessionIds << sessionId;
|
||||
}
|
||||
}
|
||||
|
@ -251,8 +252,6 @@ void Workspace::storeActivity(const QString &id)
|
|||
|
||||
kDebug() << "saveActivity" << id << saveAndClose << saveOnly;
|
||||
|
||||
openActivities_.removeOne(id); //FIXME it's not closed until ksmserver says it's closed
|
||||
|
||||
//pass off to ksmserver
|
||||
QDBusInterface ksmserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
|
||||
if (ksmserver.isValid())
|
||||
|
@ -333,10 +332,7 @@ void Workspace::loadActivity(const QString &id)
|
|||
{
|
||||
if (!allActivities_.contains(id))
|
||||
return; //bogus id
|
||||
if (openActivities_.contains(id))
|
||||
return; //already open
|
||||
|
||||
openActivities_ << id;
|
||||
loadSubSessionInfo(id);
|
||||
|
||||
QDBusInterface ksmserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
|
||||
|
|
|
@ -318,7 +318,6 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
int currentDesktop_;
|
||||
QString activity_;
|
||||
QStringList allActivities_;
|
||||
QStringList openActivities_;
|
||||
bool desktopLayoutDynamicity_;
|
||||
|
||||
KActivityController activityController_;
|
||||
|
@ -342,6 +341,7 @@ class Workspace : public QObject, public KDecorationDefines
|
|||
int screenNumber( const QPoint& pos ) const;
|
||||
QString currentActivity() const { return activity_; }
|
||||
QStringList activityList() const { return allActivities_; }
|
||||
QStringList openActivityList() const { return activityController_.listActivities(KActivityInfo::Running); }
|
||||
|
||||
// Tab box
|
||||
Client* currentTabBoxClient() const;
|
||||
|
|
Loading…
Reference in a new issue