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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/desktop/applets/tasks
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2011-01-19 22:26:31
Message-ID: 20110119222631.51CC9AC8B7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1215861 by aseigo:

avoid work where possible


 M  +10 -6     taskgroupitem.cpp  
 M  +1 -1      windowtaskitem.cpp  


--- trunk/KDE/kdebase/workspace/plasma/desktop/applets/tasks/taskgroupitem.cpp #1215860:1215861
@@ -220,8 +220,9 @@
 void TaskGroupItem::checkUpdates()
 {
     bool needsUpdate = false;
-    // task flags
     TaskFlags flags = m_flags;
+
+    if (m_changes & TaskManager::StateChanged) {
     if (m_group.data()->isActive()) {
         flags |= TaskHasFocus;
         if (!(m_flags & TaskHasFocus)) {
@@ -231,16 +232,19 @@
         flags &= ~TaskHasFocus;
     }
 
+        if (m_group.data()->isMinimized()) {
+            flags |= TaskIsMinimized;
+        } else {
+            flags &= ~TaskIsMinimized;
+        }
+    }
+
+    if (m_changes & TaskManager::AttentionChanged) {
     if (m_group.data()->demandsAttention()) {
         flags |= TaskWantsAttention;
     } else {
         flags &= ~TaskWantsAttention;
     }
-
-    if (m_group.data()->isMinimized()) {
-        flags |= TaskIsMinimized;
-    } else {
-        flags &= ~TaskIsMinimized;
     }
 
     if (flags != m_flags) {
--- trunk/KDE/kdebase/workspace/plasma/desktop/applets/tasks/windowtaskitem.cpp #1215860:1215861
@@ -144,7 +144,7 @@
     if (changes & TaskManager::StateChanged) {
         if (m_task->isActive()) {
             flags |= TaskHasFocus;
-            if (!m_flags & TaskHasFocus) {
+            if (!(m_flags & TaskHasFocus)) {
                 emit activated(this);
             }
         } else {
[prev in list] [next in list] [prev in thread] [next in thread] 

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