From 851e7ec05cad08b2d44de7705dcfeb1888a2b318 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 11 Apr 2024 06:06:33 +0300 Subject: [PATCH] plasma: drop unused category exclusion feature Signed-off-by: Ivailo Monev --- plasma/applet.cpp | 10 ++-------- plasma/applet.h | 1 - plasma/pluginloader.cpp | 10 ++-------- plasma/pluginloader.h | 1 - 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/plasma/applet.cpp b/plasma/applet.cpp index 9742c8bc..b9963b78 100644 --- a/plasma/applet.cpp +++ b/plasma/applet.cpp @@ -1993,12 +1993,6 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly) QString constraint = AppletPrivate::parentAppConstraint(parentApp); constraint.append(" and exist [X-KDE-PluginInfo-Category]"); - KConfigGroup group(KGlobal::config(), "General"); - const QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); - foreach (const QString &category, excluded) { - constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); - } - KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); QStringList categories; @@ -2006,11 +2000,11 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly) foreach (const KService::Ptr &applet, offers) { QString appletCategory = applet->property("X-KDE-PluginInfo-Category").toString(); if (visibleOnly && applet->noDisplay()) { - // we don't want to show the hidden category + // don't want to show the hidden category continue; } - //kDebug() << " and we have " << appletCategory; + // kDebug() << " and have " << appletCategory; if (!appletCategory.isEmpty() && !known.contains(appletCategory.toLower())) { kDebug() << "Unknown category: " << applet->name() << "says it is in the" << appletCategory << "category which is unknown to us"; diff --git a/plasma/applet.h b/plasma/applet.h index 092fb2e8..622de7f2 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -229,7 +229,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget /** * Returns a list of all known applets. - * This may skip applets based on ExcludeCategories in the application's config. * * @param category Only applets matchin this category will be returned. * Useful in conjunction with knownCategories. diff --git a/plasma/pluginloader.cpp b/plasma/pluginloader.cpp index 2b246bb5..89dc30e6 100644 --- a/plasma/pluginloader.cpp +++ b/plasma/pluginloader.cpp @@ -93,14 +93,8 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS { QString constraint = AppletPrivate::parentAppConstraint(parentApp); - //note: constraint guaranteed non-empty from here down - if (category.isEmpty()) { //use all but the excluded categories - KConfigGroup group(KGlobal::config(), "General"); - QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); - foreach (const QString &category, excluded) { - constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); - } - } else { //specific category (this could be an excluded one - is that bad?) + if (!category.isEmpty()) { + // specific category constraint.append(" and [X-KDE-PluginInfo-Category] == '").append(category).append("'"); if (category == "Miscellaneous") { constraint.append(" or (not exist [X-KDE-PluginInfo-Category] or [X-KDE-PluginInfo-Category] == '')"); diff --git a/plasma/pluginloader.h b/plasma/pluginloader.h index 0b394f28..ec1c7c4b 100644 --- a/plasma/pluginloader.h +++ b/plasma/pluginloader.h @@ -68,7 +68,6 @@ public: /** * Returns a list of all known applets. - * This may skip applets based on security settings and ExcludeCategories in the application's config. * * @param category Only applets matchin this category will be returned. * Useful in conjunction with knownCategories.