From kde-commits Sun Jan 13 08:20:38 2008 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Sun, 13 Jan 2008 08:20:38 +0000 To: kde-commits Subject: KDE/kdebase/workspace/plasma/applets/tasks Message-Id: <1200212438.535185.22256.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120021244423214 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)