diff --git a/components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h b/components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h --- a/components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h +++ b/components/shellprivate/widgetexplorer/kcategorizeditemsviewmodels_p.h @@ -69,10 +69,6 @@ virtual bool matches(const QString &pattern) const; /** - * sets the favorite flag for the item - */ - virtual void setFavorite(bool favorite) = 0; - /** * sets the number of running applets for the item */ virtual void setRunning(int count) = 0; diff --git a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp --- a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp +++ b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp @@ -32,13 +32,11 @@ #include PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, - const KPluginInfo& info, - FilterFlags flags) + const KPluginInfo& info) : QObject(model), m_model(model), m_info(info), m_runningCount(0), - m_favorite(flags & Favorite), m_local(false) { const QString api(m_info.property(QStringLiteral("X-Plasma-API")).toString()); @@ -146,19 +144,6 @@ return AbstractItem::matches(pattern); } -bool PlasmaAppletItem::isFavorite() const -{ - return m_favorite; -} - -void PlasmaAppletItem::setFavorite(bool favorite) -{ - if (m_favorite != favorite) { - m_favorite = favorite; - m_model->setFavorite(m_info.pluginName(), favorite); - emitDataChanged(); - } -} bool PlasmaAppletItem::isLocal() const { @@ -248,9 +233,6 @@ : QStandardItemModel(parent), m_startupCompleted(false) { - KConfig config(QStringLiteral("plasmarc")); - m_configGroup = KConfigGroup(&config, "Applet Browser"); - m_favorites = m_configGroup.readEntry("favorites").split(','); connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(populateModel(QStringList))); setSortRole(Qt::DisplayRole); @@ -323,12 +305,7 @@ //qDebug() << info.pluginName() << " is the name of the plugin at" << info.entryPath(); //qDebug() << info.name() << info.property("X-Plasma-Thumbnail"); - PlasmaAppletItem::FilterFlags flags(PlasmaAppletItem::NoFilter); - if (m_favorites.contains(info.pluginName())) { - flags |= PlasmaAppletItem::Favorite; - } - - appendRow(new PlasmaAppletItem(this, info, flags)); + appendRow(new PlasmaAppletItem(this, info)); } emit modelPopulated(); @@ -414,20 +391,6 @@ return data; } -void PlasmaAppletItemModel::setFavorite(const QString &plugin, bool favorite) -{ - if (favorite) { - if (!m_favorites.contains(plugin)) { - m_favorites.append(plugin); - } - } else { - m_favorites.removeAll(plugin); - } - - m_configGroup.writeEntry("favorites", m_favorites.join(QStringLiteral(","))); - m_configGroup.sync(); -} - QStringList PlasmaAppletItemModel::provides() const { return m_provides; diff --git a/components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h b/components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h --- a/components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h +++ b/components/shellprivate/widgetexplorer/plasmaappletitemmodel_p.h @@ -34,14 +34,7 @@ Q_OBJECT public: - enum FilterFlag { - NoFilter = 0, - Favorite = 1 - }; - - Q_DECLARE_FLAGS(FilterFlags, FilterFlag) - - PlasmaAppletItem(PlasmaAppletItemModel *model, const KPluginInfo& info, FilterFlags flags = NoFilter); + PlasmaAppletItem(PlasmaAppletItemModel *model, const KPluginInfo& info); QString pluginName() const; QString name() const override; @@ -56,8 +49,6 @@ int running() const override; bool isLocal() const; - bool isFavorite() const override; - void setFavorite(bool favorite) override; PlasmaAppletItemModel* appletItemModel(); bool matches(const QString &pattern) const override; @@ -73,7 +64,6 @@ QString m_screenshot; QString m_icon; int m_runningCount; - bool m_favorite; bool m_local; }; @@ -104,7 +94,6 @@ QMimeData *mimeData(const QModelIndexList &indexes) const override; - void setFavorite(const QString &plugin, bool favorite); void setApplication(const QString &app); void setRunningApplets(const QHash &apps); void setRunningApplets(const QString &name, int count); @@ -124,15 +113,12 @@ private: QString m_application; - QStringList m_favorites; QStringList m_provides; KConfigGroup m_configGroup; bool m_startupCompleted : 1; private Q_SLOTS: void populateModel(const QStringList &whatChanged = QStringList()); }; -Q_DECLARE_OPERATORS_FOR_FLAGS(PlasmaAppletItem::FilterFlags) - #endif /*PLASMAAPPLETSMODEL_H_*/