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

List:       kde-commits
Subject:    branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-10-14 21:11:16
Message-ID: 1255554676.586796.926.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1035377 by aseigo:

backport r1029419 since no issues have been reported with it; this should also \
resolve remaining issues associated with bug 199325. testing by people using this \
branch would be most appreciated. BUG:199325


 M  +2 -0      abstracttaskitem.cpp  
 M  +1 -0      abstracttaskitem.h  
 M  +7 -2      taskitemlayout.cpp  
 M  +7 -4      taskitemlayout.h  


--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.cpp \
#1035376:1035377 @@ -138,6 +138,8 @@
 
 AbstractTaskItem::~AbstractTaskItem()
 {
+    emit destroyed(this);
+
     if (m_animId) {
         Plasma::Animator::self()->stopCustomAnimation(m_animId);
     }
--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.h \
#1035376:1035377 @@ -130,6 +130,7 @@
 
 Q_SIGNALS:
     void activated(AbstractTaskItem *);
+    void destroyed(AbstractTaskItem *);
 
 public Q_SLOTS:
     virtual void activate() = 0;
--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/taskitemlayout.cpp \
#1035376:1035377 @@ -108,7 +108,7 @@
 bool TaskItemLayout::insert(int index, AbstractTaskItem* item)
 {
     //kDebug() << item->text() << index;
-    if (!item ) {
+    if (!item) {
         kDebug() << "error";
         return false;
     }
@@ -120,6 +120,10 @@
         }
     }
 
+    if (m_itemPositions.removeAll(item) == 0) {
+        connect(item, SIGNAL(destroyed(AbstractTaskItem*)), this, \
SLOT(remove(AbstractTaskItem*))); +    }
+
     m_itemPositions.insert(listIndex, item);
 
     layoutItems();
@@ -132,6 +136,7 @@
         kDebug() << "null Item";
     }
 
+    disconnect(item, 0, this, 0);
     m_itemPositions.removeAll(item);
     layoutItems();
     return true;
@@ -499,5 +504,5 @@
     }
 }
 
+#include "taskitemlayout.moc"
 
-
--- branches/KDE/4.3/kdebase/workspace/plasma/applets/tasks/taskitemlayout.h \
#1035376:1035377 @@ -43,8 +43,10 @@
 /**
  * A Layout for the expanded group
  */
-class TaskItemLayout : public QGraphicsGridLayout
+class TaskItemLayout : public QObject, public QGraphicsGridLayout
 {
+    Q_OBJECT
+
 public:
     TaskItemLayout(TaskGroupItem * parent, Tasks *applet);
     ~TaskItemLayout();
@@ -81,12 +83,13 @@
     void setOrientation(Plasma::FormFactor orientation);
 
 private:
-    //void calculatePreferredRowSize();
-    bool remove(AbstractTaskItem* item);
-
     void adjustStretch();
     void updatePreferredSize();
 
+private Q_SLOTS:
+    bool remove(AbstractTaskItem* item);
+
+private:
     bool m_hasSpacer;
     QGraphicsWidget *m_spacer;
 


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

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