skip applets not in formfactor

applets without a formfactor are always listed
if a formfactor is not specified, list everything
wilder-5.14
Marco Martin 11 years ago
parent 6e3c17e5c8
commit dc34aa70b4
  1. 1
      components/shellprivate/CMakeLists.txt
  2. 13
      components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp

@ -33,6 +33,7 @@ target_link_libraries(plasmashellprivateplugin
KF5::NewStuff
KF5::KIOFileWidgets
KF5::WindowSystem
KF5::Declarative
)
if (KF5TextEditor_FOUND)

@ -29,6 +29,7 @@
#include "config-workspace.h"
#include <KPluginTrader>
#include <KPackage/PackageLoader>
#include <KDeclarative/KDeclarative>
PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
const KPluginInfo& info,
@ -299,6 +300,18 @@ void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged)
continue;
}
bool inFormFactor = true;
foreach (const QString &formFactor, KDeclarative::KDeclarative::runtimePlatform()) {
if (!info.formFactors().isEmpty() &&
!info.formFactors().contains(formFactor)) {
inFormFactor = false;
}
}
if (!inFormFactor) {
continue;
}
//qDebug() << info.pluginName() << " is the name of the plugin at" << info.entryPath();
//qDebug() << info.name() << info.property("X-Plasma-Thumbnail");

Loading…
Cancel
Save