Service Type property to exclude KWin Scripts from listing in KCM
This is useful for scripts controlled from other KCMs, like e.g. DesktopChangeOSD which is controlled by the virtual desktop KCM and should not be listed in the scripts section.
This commit is contained in:
parent
70f9290fb1
commit
95ac5fa2ce
3 changed files with 5 additions and 1 deletions
|
@ -85,7 +85,7 @@ void Module::importScript()
|
|||
|
||||
void Module::updateListViewContents()
|
||||
{
|
||||
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script");
|
||||
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);
|
||||
ui->scriptSelector->addPlugins(scriptinfos, KPluginSelector::ReadConfigFile, QString(), QString(), m_kwinConfig);
|
||||
}
|
||||
|
|
|
@ -17,3 +17,6 @@ Type=QString
|
|||
|
||||
[PropertyDef::X-Plasma-MainScript]
|
||||
Type=QString
|
||||
|
||||
[PropertyDef::X-KWin-Exclude-Listing]
|
||||
Type=bool
|
||||
|
|
|
@ -5,6 +5,7 @@ Icon=preferences-system-windows-script-test
|
|||
|
||||
X-Plasma-API=declarativescript
|
||||
X-Plasma-MainScript=ui/main.qml
|
||||
X-KWin-Exclude-Listing=true
|
||||
|
||||
X-KDE-PluginInfo-Author=Martin Gräßlin
|
||||
X-KDE-PluginInfo-Email=mgraesslin@kde.org
|
||||
|
|
Loading…
Reference in a new issue