From 92a724abe3659f863effa55233fec8ea61228580 Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Sun, 2 Mar 2008 23:41:20 +0000 Subject: [PATCH] removed all SuperKaramba specific logic since we are using the ScriptEngine for this now. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=781482 --- appletbrowser/plasmaappletitemmodel.cpp | 80 ++++--------------------- appletbrowser/plasmaappletitemmodel_p.h | 1 - 2 files changed, 11 insertions(+), 70 deletions(-) diff --git a/appletbrowser/plasmaappletitemmodel.cpp b/appletbrowser/plasmaappletitemmodel.cpp index e47f59e9f..c819721a2 100644 --- a/appletbrowser/plasmaappletitemmodel.cpp +++ b/appletbrowser/plasmaappletitemmodel.cpp @@ -61,17 +61,7 @@ void PlasmaAppletItem::setFavorite(bool favorite) setData(QVariant(attrs)); QString pluginName = attrs["pluginName"].toString(); - - if (pluginName == "skapplet" && attrs.contains("arguments")) { - // skapplet can be used with all SuperKaramba themes, - // so when setting skapplet as favorite it is also - // necessary to know which theme is meant - QString themePath = qvariant_cast(attrs["arguments"])[0].toString(); - - m_model->setFavorite(pluginName + " - " + themePath, favorite); - } else { - m_model->setFavorite(pluginName, favorite); - } + m_model->setFavorite(pluginName, favorite); } void PlasmaAppletItem::setRunning(int count) @@ -130,24 +120,17 @@ void PlasmaAppletItemModel::populateModel() } //kDebug() << info.pluginName() << " is the name of the plugin\n"; - if (info.pluginName() == "skapplet") { - // If there is the SuperKaramba applet, - // add SuperKaramba themes to the - // model too - loadSuperKarambaThemes(info); - } else { - QMap attrs; - attrs.insert("name", info.name()); - attrs.insert("pluginName", info.pluginName()); - attrs.insert("description", info.comment()); - attrs.insert("category", info.category()); - attrs.insert("icon", static_cast(KIcon(info.icon().isEmpty()?"application-x-plasma":info.icon()))); + QMap attrs; + attrs.insert("name", info.name()); + attrs.insert("pluginName", info.pluginName()); + attrs.insert("description", info.comment()); + attrs.insert("category", info.category()); + attrs.insert("icon", static_cast(KIcon(info.icon().isEmpty()?"application-x-plasma":info.icon()))); - appendRow(new PlasmaAppletItem(this, attrs, - ((m_favorites.contains(info.pluginName())) ? PlasmaAppletItem::Favorite : PlasmaAppletItem::NoFilter) | - ((m_used.contains(info.pluginName())) ? PlasmaAppletItem::Used : PlasmaAppletItem::NoFilter) - , &(extraPluginAttrs[info.pluginName()]))); - } + appendRow(new PlasmaAppletItem(this, attrs, + ((m_favorites.contains(info.pluginName())) ? PlasmaAppletItem::Favorite : PlasmaAppletItem::NoFilter) | + ((m_used.contains(info.pluginName())) ? PlasmaAppletItem::Used : PlasmaAppletItem::NoFilter) + , &(extraPluginAttrs[info.pluginName()]))); } } @@ -233,44 +216,3 @@ QString& PlasmaAppletItemModel::Application() { return m_application; } - -/* - * Define function type to get the SuperKaramba themes - * from skapplet (see skapplet.cpp in kdeutils/superkaramba) - */ -extern "C" { - typedef QList > (*installedThemes)(); -} - -void PlasmaAppletItemModel::loadSuperKarambaThemes(const KPluginInfo &info) -{ - KService::Ptr service = info.service(); - QString libName = service->library(); - - // Load the Plugin as library to get access - // to installedThemes() in skapplet - KLibrary lib(libName); - installedThemes loadThemes = 0; - - loadThemes = (installedThemes)lib.resolveFunction("installedThemes"); - - if (loadThemes) { - // loadThemes() returns the name, description, the icon - // and one argument (file path) from the theme - QList > themeMetadata = loadThemes(); - - QMap metadata; - foreach (metadata, themeMetadata) { - metadata.insert("pluginName", "skapplet"); - metadata.insert("category", "SuperKaramba"); - - QString favorite = info.pluginName() + " - " + qvariant_cast(metadata["arguments"])[0].toString(); - - appendRow(new PlasmaAppletItem(this, metadata, - ((m_favorites.contains(favorite)) ? PlasmaAppletItem::Favorite : PlasmaAppletItem::NoFilter) | - ((m_used.contains(info.pluginName())) ? PlasmaAppletItem::Used : PlasmaAppletItem::NoFilter))); - } - } else { - kWarning() << "Could not load" << libName << "; KLibrary said:" << lib.errorString(); - } -} diff --git a/appletbrowser/plasmaappletitemmodel_p.h b/appletbrowser/plasmaappletitemmodel_p.h index 2381f0501..744cd37a6 100644 --- a/appletbrowser/plasmaappletitemmodel_p.h +++ b/appletbrowser/plasmaappletitemmodel_p.h @@ -81,7 +81,6 @@ private: QStringList m_used; KConfigGroup m_configGroup; - void loadSuperKarambaThemes(const KPluginInfo &info); void populateModel(); };