From kde-commits Tue Jan 25 00:24:19 2011 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Tue, 25 Jan 2011 00:24:19 +0000 To: kde-commits Subject: KDE/kdebase/workspace/libs/taskmanager Message-Id: <20110125002419.9CBADAC8B9 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129591508922702 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 +#include + #include #include #include @@ -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 */