[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-08-02 18:58:46
Message-ID: 1249239526.807313.1222.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005989 by aseigo:

protect usage of task(), as that can be null


 M  +2 -4      taskgroupitem.cpp  
 M  +4 -4      windowtaskitem.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.cpp #1005988:1005989
@@ -290,14 +290,12 @@
 
         TaskManager::TaskItem *taskItem = qobject_cast<TaskManager::TaskItem *>(item);
 
-        if (taskItem) {
+        if (taskItem && taskItem->task()) {
             windows.append(taskItem->task()->window());
         }
     }
 
     data.setWindowsToPreview(windows);
-
-
     Plasma::ToolTipManager::self()->setContent(this, data);
 }
 
@@ -558,7 +556,7 @@
                 //TODO: recurse through sub-groups?
             } else {
                 TaskItem * item = dynamic_cast<TaskItem*>(groupable);
-                if (item) {
+                if (item && item->task()) {
                     ids << item->task()->info().win();
                 }
             }
--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/windowtaskitem.cpp #1005988:1005989
@@ -82,7 +82,7 @@
     // in a widget such as a line edit which does accept the focus)
     // this needs to be implemented for Plasma's own panels.
     //kDebug();
-    if (m_task) {
+    if (m_task && m_task->task()) {
         m_task->task()->activateRaiseOrIconify();
        // emit windowSelected(this);
     }
@@ -110,7 +110,7 @@
 
 void WindowTaskItem::publishIconGeometry() const
 {
-    if (!m_task) {
+    if (!m_task || !m_task->task()) {
         return;
     }
 
@@ -120,7 +120,7 @@
 
 void WindowTaskItem::publishIconGeometry(const QRect &rect) const
 {
-    if (m_task) {
+    if (m_task && m_task->task()) {
         m_task->task()->publishIconGeometry(rect);
     }
 }
@@ -185,7 +185,7 @@
 
 void WindowTaskItem::updateToolTip()
 {
-    if (!m_task) {
+    if (!m_task || !m_task->task()) {
         return;
     } 
    
[prev in list] [next in list] [prev in thread] [next in thread] 

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