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

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/taskmanager
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2011-01-25 0:24:19
Message-ID: 20110125002419.9CBADAC8B9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1216811 by aseigo:

move launcher config reading into GroupManager


 M  +22 -0     groupmanager.cpp  
 M  +3 -0      groupmanager.h  


--- trunk/KDE/kdebase/workspace/libs/taskmanager/groupmanager.cpp #1216810:1216811
@@ -660,6 +660,28 @@
     return d->launchers.value(url);
 }
 
+void GroupManager::readLauncherConfig(const KConfigGroup &config)
+{
+    foreach (const QString &key, config.keyList()) {
+        QStringList item = config.readEntry(key, QStringList());
+        if (item.length() >= 4) {
+            KUrl url(item.at(0));
+            KIcon icon;
+            if (!item.at(1).isEmpty()) {
+                icon = KIcon(item.at(1));
+            } else if (item.length() >= 5) {
+                QPixmap pixmap;
+                QByteArray bytes = QByteArray::fromBase64(item.at(4).toAscii());
+                pixmap.loadFromData(bytes);
+                icon.addPixmap(pixmap);
+            }
+            QString name(item.at(2));
+            QString genericName(item.at(3));
+            addLauncher(url, icon, name, genericName);
+        }
+    }
+}
+
 bool GroupManager::onlyGroupWhenFull() const
 {
     return d->onlyGroupWhenFull;
--- trunk/KDE/kdebase/workspace/libs/taskmanager/groupmanager.h #1216810:1216811
@@ -26,6 +26,8 @@
 
 #include <QtCore/QObject>
 
+#include <KConfigGroup>
+
 #include <taskmanager/abstractgroupableitem.h>
 #include <taskmanager/task.h>
 #include <taskmanager/taskitem.h>
@@ -135,6 +137,7 @@
     /** @return true if there is a matching launcher */
     bool launcherExists(const KUrl &url) const;
     bool launcherExistsForUrl(const KUrl &url) const;
+    void readLauncherConfig(const KConfigGroup &config);
 
 Q_SIGNALS:
     /** Signal that the rootGroup has to be reloaded in the visualization */
[prev in list] [next in list] [prev in thread] [next in thread] 

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