[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:       2009-07-07 20:10:35
Message-ID: 1246997435.361572.10508.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 992852 by aseigo:

* don't assert but return quietly from the updated slot if there's no group
* disconnect the signals from the old group when leaving it behind (probably the \
                source of bug 199322)
* delete the layout right away when the group item is deleted so that it doesn't get \
stuck with an old and now no longer valid group while it waits for qobject to clean \
                it up
* some minor cleanups that snuck in
BUG:199322


 M  +24 -7     taskgroupitem.cpp  
 M  +1 -0      taskgroupitem.h  


--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.cpp #992851:992852
@@ -77,6 +77,11 @@
 }
 
 
+TaskGroupItem::~TaskGroupItem()
+{
+    delete m_tasksLayout;
+}
+
 bool TaskGroupItem::isSplit()
 {
     return m_childSplitGroup != 0;
@@ -186,13 +191,20 @@
         m_popupDialog->deleteLater();
         m_popupDialog = 0;
     }
+
+    if (m_group) {
+        disconnect(m_group, 0, this, 0);
+    }
+
     m_group = 0;
 }
 
 
 void TaskGroupItem::updateTask(::TaskManager::TaskChanges changes)
 {
-    Q_ASSERT(m_group);
+    if (!m_group) {
+        return;
+    }
 
     bool needsUpdate = false;
     // task flags
@@ -283,7 +295,7 @@
 {
     QList <AbstractGroupableItem *> itemsToRemove = m_groupMembers.keys();
 
-    foreach (AbstractGroupableItem * item, group()->members()) {
+    foreach (AbstractGroupableItem *item, group()->members()) {
         if (!item) {
             kDebug() << "invalid Item";
             continue;
@@ -299,6 +311,7 @@
             }
         }
     }
+
     foreach (AbstractGroupableItem * item, itemsToRemove) { //remove unused items
         if (!item) {
             kDebug() << "invalid Item";
@@ -316,6 +329,10 @@
         return;
     }
 
+    if (m_group) {
+        disconnect(m_group, 0, this, 0);
+    }
+
     m_group = group;
     m_abstractItem = qobject_cast<AbstractGroupableItem *>(group);
 
@@ -491,7 +508,7 @@
         return;
     }
 
-    AbstractTaskItem *item = m_groupMembers.take(groupableItem);;
+    AbstractTaskItem *item = m_groupMembers.take(groupableItem);
 
     if (!item) {
         kDebug() << "Item not found";
@@ -706,12 +723,12 @@
 void TaskGroupItem::constraintsChanged(Plasma::Constraints constraints)
 {
     //kDebug();
-    if (constraints & Plasma::SizeConstraint && tasksLayout()) {
-        tasksLayout()->layoutItems();
+    if (constraints & Plasma::SizeConstraint && m_tasksLayout) {
+        m_tasksLayout->layoutItems();
     }
 
-    if (constraints & Plasma::FormFactorConstraint && tasksLayout()) {
-        tasksLayout()->setOrientation(m_applet->formFactor());
+    if (constraints & Plasma::FormFactorConstraint && m_tasksLayout) {
+        m_tasksLayout->setOrientation(m_applet->formFactor());
     }
 }
 
--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.h #992851:992852
@@ -55,6 +55,7 @@
 public:
     /** Constructs a new representation for a taskgroup. */
     TaskGroupItem(QGraphicsWidget *parent, Tasks *applet);
+    ~TaskGroupItem();
 
     /** Sets the group represented by this task. */
     void setGroup(TaskManager::GroupPtr);


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

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