From 1bd40e27b6ef68856fef070ab01eade9de7b1572 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 2 Dec 2020 14:58:09 +0100 Subject: [PATCH] Fix alternatives for applets X-Plasma-Provides is a list of strings, not a single string BUG: 429801 BUG: 429800 --- .../widgetexplorer/plasmaappletitemmodel.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp index c7dd8d2a1..cee1da826 100644 --- a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp +++ b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp @@ -271,10 +271,16 @@ void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged) auto filter = [this](const KPluginMetaData &plugin) -> bool { - const QString provides = plugin.value(QStringLiteral("X-Plasma-Provides")); + const QStringList provides = KPluginMetaData::readStringList(plugin.rawData(), QStringLiteral("X-Plasma-Provides")); - if (!m_provides.isEmpty() && !m_provides.contains(provides)) { - return false; + if (!m_provides.isEmpty()) { + const bool providesFulfilled = std::any_of(m_provides.cbegin(), m_provides.cend(), [&provides](const QString &p) { + return provides.contains(p); + }); + + if (!providesFulfilled) { + return false; + } } if (!plugin.isValid() || plugin.rawData().value(QStringLiteral("NoDisplay")).toBool() || plugin.category() == QLatin1String("Containments")) {