Commits

flupp  committed b17deac

Task.{h,cpp}: removed useless code for transition from StartupItem to TaskItem

The code was useless because SLOT(gotTaskPointer()) is conected to SIGNAL(gotTaskPointer()) of m_task. So the sender in SLOT(gotTaskPointer()) must be m_task, which renders the update of m_task useless.

  • Participants
  • Parent commits 16c4184

Comments (0)

Files changed (2)

File applet/SmoothTasks/Task.cpp

 }
 
 void Task::gotTaskPointer() {
-	TaskManager::TaskItem *item = qobject_cast<TaskManager::TaskItem*>(sender());
-
-	if (item) {
-		setWindowTask(item);
-	}
-}
-
-// XXX: do I have to tell the applet about this?
-void Task::setWindowTask(TaskManager::TaskItem* taskItem) {
 	m_type = TaskItem;
-	if (m_task && m_task->task()) {
-		disconnect(m_task->task(), 0, this, 0);
-	}
-	
-	m_task = taskItem;
-	m_abstractItem = qobject_cast<TaskManager::AbstractGroupableItem *>(taskItem);
-	
-	if (m_abstractItem) {
-		connect(m_abstractItem, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed()));
-	}
-	
-	connect(
-		m_task, SIGNAL(changed(::TaskManager::TaskChanges)),
-		this, SLOT(updateTask(::TaskManager::TaskChanges)));
 	
 	updateTask(::TaskManager::EverythingChanged);
 	

File applet/SmoothTasks/Task.h

 	bool                    isValid() const { return m_abstractItem != NULL; }
 
 private:
-	void setWindowTask(TaskManager::TaskItem* taskItem);
-
 	TaskManager::TaskItem              *m_task;
 	TaskManager::TaskGroup             *m_group;
 	TaskManager::LauncherItem		   *m_launcher;