diff --git a/kcmkwin/kwintabbox/CMakeLists.txt b/kcmkwin/kwintabbox/CMakeLists.txt
index 3241390775..d2db994579 100644
--- a/kcmkwin/kwintabbox/CMakeLists.txt
+++ b/kcmkwin/kwintabbox/CMakeLists.txt
@@ -26,6 +26,7 @@ target_link_libraries(kcm_kwintabbox
KF5::I18n
KF5::Service
KF5::NewStuff
+ KF5::Plasma
XCB::XCB
kwin4_effect_builtins
)
diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp
index 1e94b7ea1d..632f4643df 100644
--- a/kcmkwin/kwintabbox/main.cpp
+++ b/kcmkwin/kwintabbox/main.cpp
@@ -42,6 +42,9 @@ along with this program. If not, see .
#include
#include
#include
+// Plasma
+#include
+#include
// own
#include "tabboxconfig.h"
@@ -158,6 +161,36 @@ KWinTabBoxConfig::~KWinTabBoxConfig()
{
}
+
+static QList availableLnFPackages()
+{
+ QList packages;
+ QStringList paths;
+ const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+
+ for (const QString &path : dataPaths) {
+ QDir dir(path + QStringLiteral("/plasma/look-and-feel"));
+ paths << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
+ }
+
+ const auto &p = paths;
+ for (const QString &path : p) {
+ Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel"));
+ pkg.setPath(path);
+ pkg.setFallbackPackage(Plasma::Package());
+ if (!pkg.filePath("defaults").isEmpty()) {
+ KSharedConfigPtr conf = KSharedConfig::openConfig(pkg.filePath("defaults"));
+ KConfigGroup cg = KConfigGroup(conf, "kwinrc");
+ cg = KConfigGroup(&cg, "WindowSwitcher");
+ if (!cg.readEntry("LayoutName", QString()).isEmpty()) {
+ packages << pkg;
+ }
+ }
+ }
+
+ return packages;
+}
+
void KWinTabBoxConfig::initLayoutLists()
{
// search the effect names
@@ -167,6 +200,15 @@ void KWinTabBoxConfig::initLayoutLists()
KServiceTypeTrader* trader = KServiceTypeTrader::self();
KService::List offers = trader->query("KWin/WindowSwitcher");
QStringList layoutNames, layoutPlugins, layoutPaths;
+
+ const auto lnfPackages = availableLnFPackages();
+ for (const auto &package : lnfPackages) {
+ const auto &metaData = package.metadata();
+ layoutNames << metaData.name();
+ layoutPlugins << metaData.pluginName();
+ layoutPaths << package.filePath("windowswitcher", QStringLiteral("WindowSwitcher.qml"));
+ }
+
foreach (KService::Ptr service, offers) {
const QString pluginName = service->property("X-KDE-PluginInfo-Name").toString();
if (service->property("X-Plasma-API").toString() != "declarativeappletscript") {