Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinscripts/module.cpp
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 100 | { | |||
---|---|---|---|---|---|
120 | 120 | | |||
121 | updateListViewContents(); | 121 | updateListViewContents(); | ||
122 | 122 | | |||
123 | emit changed(true); | 123 | emit changed(true); | ||
124 | } | 124 | } | ||
125 | 125 | | |||
126 | void Module::updateListViewContents() | 126 | void Module::updateListViewContents() | ||
127 | { | 127 | { | ||
128 | auto filter = [](const KPluginMetaData &md) { | 128 | auto filter = [](const KPluginMetaData &md) { | ||
129 | if (md.value(QStringLiteral("X-KWin-Exclude-Listing")) == QLatin1String("true") ) { | 129 | return !md.rawData().value("X-KWin-Exclude-Listing").toBool(); | ||
zzag: Can be simplified to
```lang=cpp
return !md.rawData().value("X-KWin-Exclude-Listing").toBool()… | |||||
130 | return false; | | |||
131 | } | | |||
132 | return true; | | |||
133 | }; | 130 | }; | ||
134 | 131 | | |||
135 | const QString scriptFolder = QStringLiteral("kwin/scripts/"); | 132 | const QString scriptFolder = QStringLiteral("kwin/scripts/"); | ||
136 | const auto scripts = KPackage::PackageLoader::self()->findPackages(QStringLiteral("KWin/Script"), scriptFolder, filter); | 133 | const auto scripts = KPackage::PackageLoader::self()->findPackages(QStringLiteral("KWin/Script"), scriptFolder, filter); | ||
137 | 134 | | |||
138 | QList<KPluginInfo> scriptinfos = KPluginInfo::fromMetaData(scripts.toVector()); | 135 | QList<KPluginInfo> scriptinfos = KPluginInfo::fromMetaData(scripts.toVector()); | ||
139 | 136 | | |||
140 | ui->scriptSelector->addPlugins(scriptinfos, KPluginSelector::ReadConfigFile, QString(), QString(), m_kwinConfig); | 137 | ui->scriptSelector->addPlugins(scriptinfos, KPluginSelector::ReadConfigFile, QString(), QString(), m_kwinConfig); | ||
Show All 25 Lines |
Can be simplified to