Map NULL_UUID activity to ALL activities

REVIEW: 109274
BUG: 314830
FIXED-IN: 4.10.2
This commit is contained in:
Thomas Lübking 2013-03-02 22:27:20 +01:00
parent 1bc2d7d3b7
commit c0f3895ba7

View file

@ -1518,12 +1518,16 @@ void Client::setOnActivity(const QString &activity, bool enable)
/**
* set exactly which activities this client is on
*/
#define NULL_UUID "00000000-0000-0000-0000-000000000000"
void Client::setOnActivities(QStringList newActivitiesList)
{
QString joinedActivitiesList = newActivitiesList.join(",");
joinedActivitiesList = rules()->checkActivity(joinedActivitiesList, false);
newActivitiesList = joinedActivitiesList.split(',', QString::SkipEmptyParts);
if (newActivitiesList.contains(NULL_UUID))
newActivitiesList.clear(); // turn into "all"
QStringList allActivities = workspace()->activityList();
if ( newActivitiesList.isEmpty() ||
(newActivitiesList.count() > 1 && newActivitiesList.count() == allActivities.count()) ||
@ -2380,6 +2384,12 @@ void Client::checkActivities()
}
newActivitiesList = QString(prop).split(',');
if (newActivitiesList.contains(NULL_UUID)) {
setOnAllActivities(true);
return;
}
if (newActivitiesList == activityList)
return; //expected change, it's ok.