Commits

flupp committed 9c19348

cleanup w.r.t. SmoothTasks::Applet::reloadItems() – fixes spurious launcher item

Comments (0)

Files changed (2)

applet/SmoothTasks/Applet.cpp

 	if (appletContainment) {
 		m_groupManager->setScreen(appletContainment->screen());
 	}
-	
-	connect(
-		this, SIGNAL(settingsChanged()),
-		this, SLOT(reconnectGroupManager()));
 
 	connectRootGroup();
 		
 	setMaximumSize(INT_MAX, INT_MAX);
 }
 
-void Applet::reconnectGroupManager() {
-	m_groupManager->reconnect();
-	reload();
-}
-
 void Applet::connectRootGroup() {
 	TaskManager::TaskGroup *group = m_rootGroup.data();
 	
 		disconnectRootGroup();
 		m_rootGroup = group;
 		connectRootGroup();
+		reloadItems();
 	}
-
-	reloadItems();
 }
 
 void Applet::reloadItems() {
 	foreach(AbstractGroupableItem* item, m_groupManager->rootGroup()->members()) {
 		itemAdded(item);
 	}
-	KConfigGroup cg = config();
-    
-    //load launchers
-    KConfigGroup launcherCg(&cg, "Launchers");
-	foreach (const QString &key, launcherCg.keyList()) {
-		QStringList item = launcherCg.readEntry(key, QStringList());
-		if (item.length() >= 4) {
-			KUrl url(item[0]);
-			KIcon icon;
-			if (!item[1].isEmpty()) {
-				icon = KIcon(item[1]);
-			} else if (item.length() >= 5) {
-				QPixmap pixmap;
-				QByteArray bytes = QByteArray::fromBase64(item[4].toAscii());
-				pixmap.loadFromData(bytes);
-				icon.addPixmap(pixmap);
-			}
-			QString name(item[2]);
-			QString genericName(item[3]);
-			m_groupManager->addLauncher(url, icon, name, genericName);
-		}
-	}
-    
 }
 
 void Applet::updateFullLimit() {

applet/SmoothTasks/Applet.h

 	void reload();
 
 private slots:
-	void reconnectGroupManager();
 	void updateFullLimit();
 	void widgetValueChanged();
 	void loadDefaults();