Commits

flupp committed c330511

refs ticket #6: fixed spurious blank taskbar items

  • Participants
  • Parent commits 07b46c7
  • Branches kde-4.6

Comments (0)

Files changed (1)

applet/SmoothTasks/Applet.cpp

 		return;
 	}
 
-	TaskItem *item = new TaskItem(groupableItem, this);
-	m_toolTip->registerItem(item);
-	connect(item, SIGNAL(itemActive(TaskItem*)), this, SLOT(updateActiveIconIndex(TaskItem*)));
-	
 	if (groupableItem->itemType() == TaskManager::GroupItemType) {
 		TaskManager::TaskGroup* group = static_cast<TaskManager::TaskGroup*>(groupableItem);
 		connect(
 		connect(
 			group, SIGNAL(itemRemoved(AbstractGroupableItem*)),
 			this, SLOT(updateFullLimit()));
+	} else if (groupableItem->itemType() == TaskManager::LauncherItemType) {
+	} else {
+		// copied from default task plasmoid
+		TaskManager::TaskItem * taskItem = static_cast<TaskManager::TaskItem*>(groupableItem);
+		//if the taskItem is not either a startup o a task, return 0;
+		if (!taskItem->startup() && !taskItem->task()) {
+			return;
+		}
 	}
 	
 	int index = m_groupManager->rootGroup()->members().indexOf(groupableItem);
 
+	TaskItem *item = new TaskItem(groupableItem, this);
+	m_toolTip->registerItem(item);
+	connect(item, SIGNAL(itemActive(TaskItem*)), this, SLOT(updateActiveIconIndex(TaskItem*)));
+
 	m_layout->insertItem(index, item);
 	m_tasksHash[groupableItem] = item;
 	updateFullLimit();