KDE/kdebase/workspace/plasma/desktop/shell

Chani Armitage chanika at gmail.com
Mon Nov 8 10:24:30 CET 2010


SVN commit 1194120 by chani:

containments with invalid ID are deleted instead of respawning
(unless the activitymanager is down, of course)

do you think I should do the same for all orphans, if a migration has
already happened?
CCMAIL:plasma-devel at kde.org

 M  +9 -11     desktopcorona.cpp  


--- trunk/KDE/kdebase/workspace/plasma/desktop/shell/desktopcorona.cpp #1194119:1194120
@@ -533,9 +533,8 @@
 
     QStringList newActivities;
     QString newCurrentActivity;
-    QHash<QString,QString> invalidIds;
     //migration checks:
-    //-containments with an invalid id are given a new one and kept together.
+    //-containments with an invalid id are deleted.
     //-containments that claim they were on a screen are kept together, and are preferred if we
     //need to initialize the current activity.
     //-containments that don't know where they were or who they were with just get made into their
@@ -548,15 +547,13 @@
             QString oldId = context->currentActivityId();
             if (!oldId.isEmpty()) {
                 if (existingActivities.contains(oldId)) {
-                    continue;
+                    continue; //it's already claimed
                 }
                 kDebug() << "invalid id" << oldId;
-                if (invalidIds.contains(oldId)) {
-                    //it belongs with one of the already-rescued ones
-                    context->setCurrentActivityId(invalidIds.value(oldId));
+                //byebye
+                cont->destroy(false);
                     continue;
                 }
-            }
             if (cont->screen() > -1) {
                 //it belongs on the current activity
                 if (!newCurrentActivity.isEmpty()) {
@@ -572,9 +569,6 @@
             QString id = m_activityController->addActivity(context->currentActivity());
             context->setCurrentActivityId(id);
             newActivities << id;
-            if (!oldId.isEmpty()) {
-                invalidIds.insert(oldId, id);
-            }
             if (cont->screen() > -1) {
                 newCurrentActivity = id;
             }
@@ -598,7 +592,11 @@
         if (existingActivities.isEmpty()) {
             if (newCurrentActivity.isEmpty()) {
                 if (newActivities.isEmpty()) {
-                    kDebug() << "no activities!?! can't happen!!!";
+                    kDebug() << "no activities!?! Bad activitymanager, no cookie!";
+                    QString id = m_activityController->addActivity(i18n("unnamed"));
+                    activityAdded(id);
+                    m_activityController->setCurrentActivity(id);
+                    kDebug() << "created emergency activity" << id;
                 } else {
                     m_activityController->setCurrentActivity(newActivities.first());
                 }


More information about the Plasma-devel mailing list