Commit 1bd40e27 authored by Nicolas Fella's avatar Nicolas Fella

Fix alternatives for applets

X-Plasma-Provides is a list of strings, not a single string

BUG: 429801
BUG: 429800
parent e0c8b17d
......@@ -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")) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment