Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
KDE:Frameworks5:LTS
kwin5
0001-Use-KPackage-in-kcmscripts.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Use-KPackage-in-kcmscripts.patch of Package kwin5
From 9f55a53b78bf694655634f920339b92a88f22e92 Mon Sep 17 00:00:00 2001 From: David Edmundson <kde@davidedmundson.co.uk> Date: Fri, 7 Oct 2016 13:27:19 +0100 Subject: [PATCH 1/5] Use KPackage in kcmscripts Test Plan: Tested all but show OSD appeared Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: graesslin, plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2977 --- kcmkwin/kwinscripts/CMakeLists.txt | 1 + kcmkwin/kwinscripts/module.cpp | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/kcmkwin/kwinscripts/CMakeLists.txt b/kcmkwin/kwinscripts/CMakeLists.txt index ad19db60c..c6cd344ce 100644 --- a/kcmkwin/kwinscripts/CMakeLists.txt +++ b/kcmkwin/kwinscripts/CMakeLists.txt @@ -18,6 +18,7 @@ target_link_libraries(kcm_kwin_scripts KF5::KCMUtils KF5::KIOCore KF5::I18n + KF5::Package KF5::Plasma KF5::NewStuff ) diff --git a/kcmkwin/kwinscripts/module.cpp b/kcmkwin/kwinscripts/module.cpp index 7ecf96367..6b0519f58 100644 --- a/kcmkwin/kwinscripts/module.cpp +++ b/kcmkwin/kwinscripts/module.cpp @@ -33,8 +33,10 @@ #include <KMessageBox> #include <KMessageWidget> #include <KPluginInfo> -#include <KServiceTypeTrader> +#include <KPackage/PackageLoader> +#include <KPackage/Package> #include <Plasma/Package> + #include <KNewStuff3/KNS3/DownloadDialog> #include "version.h" @@ -95,8 +97,18 @@ void Module::importScript() void Module::updateListViewContents() { - KService::List offers = KServiceTypeTrader::self()->query("KWin/Script", "not (exist [X-KWin-Exclude-Listing]) or [X-KWin-Exclude-Listing] == false"); - QList<KPluginInfo> scriptinfos = KPluginInfo::fromServices(offers); + auto filter = [](const KPluginMetaData &md) { + if (md.value(QStringLiteral("X-KWin-Exclude-Listing")) == QLatin1String("true") ) { + return false; + } + return true; + }; + + const QString scriptFolder = QStringLiteral("kwin/scripts/"); + const auto scripts = KPackage::PackageLoader::self()->findPackages(QStringLiteral("KWin/Script"), scriptFolder, filter); + + QList<KPluginInfo> scriptinfos = KPluginInfo::fromMetaData(scripts.toVector()); + ui->scriptSelector->addPlugins(scriptinfos, KPluginSelector::ReadConfigFile, QString(), QString(), m_kwinConfig); } -- 2.13.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor