[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/tasks
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-01-13 8:20:38
Message-ID: 1200212438.535185.22256.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 760654 by aseigo:

future proof this a bit: this will make it much easier to make it so we can move \
items between groups in the future


 M  +9 -1      taskgroupitem.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.cpp #760653:760654
@@ -101,13 +101,21 @@
 
 void TaskGroupItem::removeTask(AbstractTaskItem *item)
 {
+    bool found = false;
     for (int i = 0; i < _tasks.count(); i++) {
         if (_tasks[i].task == item) {
             _tasks.removeAt(i);
+            found = true;
+            break;
         }
     }
 
+    if (!found) {
+        return;
+    }
+
     layout()->removeItem(item);
+    item->setParentItem(0);
     queueGeometryUpdate();
 
     // if the group is now empty then ask the parent to remove it
@@ -121,7 +129,7 @@
     }
 
     disconnect(item, SIGNAL(activated(AbstractTaskItem *)),
-            this, SLOT(updateActive(AbstractTaskItem *)));
+               this, SLOT(updateActive(AbstractTaskItem *)));
 }
 
 void TaskGroupItem::updateActive(AbstractTaskItem *task)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic