Commit 9dba1a78 authored by Marco Martin's avatar Marco Martin
Browse files

proper form factor filtering

consider an applet acceptable for the formfactor if at least one
of its formfactors are contained in KDeclarative::runtimePlatform

or if either KDeclarative::runtimePlatform or applet formfactors
are empty.
(before informFactor failed if even one of the applet supported
formfactors was not in runtimePlatform

BUG:433983
parent 35d48002
......@@ -279,12 +279,14 @@ void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged)
return false;
}
bool inFormFactor = true;
static const auto formFactors = KDeclarative::KDeclarative::runtimePlatform();
// If runtimePlatformis not defined, accept everything
bool inFormFactor = formFactors.isEmpty();
for (const QString &formFactor : formFactors) {
if (!plugin.formFactors().isEmpty() && !plugin.formFactors().contains(formFactor)) {
inFormFactor = false;
if (plugin.formFactors().isEmpty() || plugin.formFactors().contains(formFactor)) {
inFormFactor = true;
break;
}
}
......
Supports Markdown
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