From dc34aa70b45f5b59ffebb62aa6916bbbb0864708 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 27 Oct 2015 11:50:37 +0100 Subject: [PATCH] skip applets not in formfactor applets without a formfactor are always listed if a formfactor is not specified, list everything --- components/shellprivate/CMakeLists.txt | 1 + .../widgetexplorer/plasmaappletitemmodel.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/components/shellprivate/CMakeLists.txt b/components/shellprivate/CMakeLists.txt index 9e57b5577..6baded8a6 100644 --- a/components/shellprivate/CMakeLists.txt +++ b/components/shellprivate/CMakeLists.txt @@ -33,6 +33,7 @@ target_link_libraries(plasmashellprivateplugin KF5::NewStuff KF5::KIOFileWidgets KF5::WindowSystem + KF5::Declarative ) if (KF5TextEditor_FOUND) diff --git a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp index 17b1162ff..d5c8d3806 100644 --- a/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp +++ b/components/shellprivate/widgetexplorer/plasmaappletitemmodel.cpp @@ -29,6 +29,7 @@ #include "config-workspace.h" #include #include +#include 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");