SVN commit 989342 by aseigo: be careful not to duplicate timers. seems to be the last of the taskbar cpu usage. after several hours running with this, plasma is still cpu-silent. all of tody's commits to tasks need to be backported to 4.3.0 M +9 -1 abstracttaskitem.cpp M +1 -1 abstracttaskitem.h M +5 -5 taskgroupitem.cpp M +1 -1 taskgroupitem.h M +1 -1 tasks.cpp M +2 -2 windowtaskitem.cpp M +1 -1 windowtaskitem.h --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.cpp #989341:989342 @@ -61,7 +61,7 @@ static const int HOVER_EFFECT_TIMEOUT = 800; -AbstractTaskItem::AbstractTaskItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip) +AbstractTaskItem::AbstractTaskItem(QGraphicsWidget *parent, Tasks *applet) : QGraphicsWidget(parent), m_abstractItem(0), m_applet(applet), @@ -290,6 +290,10 @@ Q_UNUSED(event) fadeBackground("hover", 175, true); if (parentGroup()) { + if (m_hoverEffectTimerId) { + killTimer(m_hoverEffectTimerId); + } + m_hoverEffectTimerId = startTimer(HOVER_EFFECT_TIMEOUT); } } @@ -862,6 +866,10 @@ { QGraphicsWidget::setGeometry(geometry); if (m_lastGeometryUpdate.elapsed() < 350) { + if (m_updateGeometryTimerId) { + killTimer(m_updateGeometryTimerId); + } + m_updateGeometryTimerId = startTimer(350 - m_lastGeometryUpdate.elapsed()); } else { publishIconGeometry(); --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/abstracttaskitem.h #989341:989342 @@ -54,7 +54,7 @@ public: /** Constructs a new representation for an abstract task. */ - AbstractTaskItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip); + AbstractTaskItem(QGraphicsWidget *parent, Tasks *applet); /** Destruct the representation for an abstract task. */ ~AbstractTaskItem(); --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.cpp #989341:989342 @@ -54,8 +54,8 @@ #include "taskitemlayout.h" #include "windowtaskitem.h" -TaskGroupItem::TaskGroupItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip) - : AbstractTaskItem(parent, applet, showTooltip), +TaskGroupItem::TaskGroupItem(QGraphicsWidget *parent, Tasks *applet) + : AbstractTaskItem(parent, applet), m_group(0), m_tasksLayout(0), m_popupMenuTimer(0), @@ -151,7 +151,7 @@ if (!m_childSplitGroup) { //kDebug() << "Normal scene " << scene(); - m_childSplitGroup = new TaskGroupItem(this, m_applet, true); + m_childSplitGroup = new TaskGroupItem(this, m_applet); m_childSplitGroup->setSplitGroup(m_group); } @@ -407,11 +407,11 @@ AbstractTaskItem *item = 0; if (groupableItem->isGroupItem()) { - TaskGroupItem *groupItem = new TaskGroupItem(this, m_applet, m_applet->showToolTip()); + TaskGroupItem *groupItem = new TaskGroupItem(this, m_applet); groupItem->setGroup(static_cast(groupableItem)); item = groupItem; } else { //it's a window task - WindowTaskItem *windowItem = new WindowTaskItem(this, m_applet, m_applet->showToolTip()); + WindowTaskItem *windowItem = new WindowTaskItem(this, m_applet); windowItem->setTask(static_cast(groupableItem)); item = windowItem; } --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/taskgroupitem.h #989341:989342 @@ -54,7 +54,7 @@ public: /** Constructs a new representation for a taskgroup. */ - TaskGroupItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip); + TaskGroupItem(QGraphicsWidget *parent, Tasks *applet); /** Sets the group represented by this task. */ void setGroup(TaskManager::GroupPtr); --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.cpp #989341:989342 @@ -89,7 +89,7 @@ // connect(m_groupManager, SIGNAL(reload()), this, SLOT(reload())); connect(this, SIGNAL(settingsChanged()), m_groupManager, SLOT(reconnect())); - m_rootGroupItem = new TaskGroupItem(this, this, false); + m_rootGroupItem = new TaskGroupItem(this, this); m_rootGroupItem->expand(); m_rootGroupItem->setGroup(m_groupManager->rootGroup()); --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/windowtaskitem.cpp #989341:989342 @@ -58,8 +58,8 @@ #include #endif -WindowTaskItem::WindowTaskItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip) - : AbstractTaskItem(parent, applet, showTooltip), +WindowTaskItem::WindowTaskItem(QGraphicsWidget *parent, Tasks *applet) + : AbstractTaskItem(parent, applet), m_task(0) { } --- trunk/KDE/kdebase/workspace/plasma/applets/tasks/windowtaskitem.h #989341:989342 @@ -36,7 +36,7 @@ public: /** Constructs a new representation for a window task. */ - WindowTaskItem(QGraphicsWidget *parent, Tasks *applet, const bool showTooltip); + WindowTaskItem(QGraphicsWidget *parent, Tasks *applet); /** Sets the window/startup represented by this task. */ void setTask(TaskManager::TaskItem* taskItem);