| 156 | } |
| 157 | |
| 158 | ScriptedEffect *ScriptedEffect::create(const KPluginMetaData &effect) |
| 159 | { |
| 160 | const QString name = effect.pluginId(); |
| 161 | QString scriptFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, KWIN_DATADIR + QLatin1String("/effects/") + name + QLatin1String("/contents/code/main.js")); |
| 162 | if (scriptFile.isEmpty()) { |
| 163 | scriptFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kwin/effects/") + name + QLatin1String("/contents/code/main.js")); |
| 164 | if (scriptFile.isEmpty()) { |
| 165 | qCDebug(KWIN_SCRIPTING) << "Could not locate effect script" << name; |
| 166 | return nullptr; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | return ScriptedEffect::create(name, scriptFile, effect.value(QStringLiteral("X-KDE-Ordering"), 0), effect.value(QStringLiteral("X-KWin-Exclusive-Category"))); |
| 171 | } |
| 172 | |
| 173 | ScriptedEffect *ScriptedEffect::create(const QString &effectName, const QString &pathToScript, int chainPosition, const QString &exclusiveCategory) |
| 174 | { |