From 048540a7c5bc73d455dcd8a53d2afdc0857a316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 2 Feb 2012 14:34:59 +0100 Subject: [PATCH] Fix error in package structure of scripted effects The Plasma package structure contains a subdirectory "contents". Furthermore we have to use locate instead of locateLocal to find system wide installed packages and adding some debug output for the case that the script cannot be found. --- effects.cpp | 3 ++- scripting/scriptedeffect.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/effects.cpp b/effects.cpp index 4da5753e3c..8e73780066 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1236,13 +1236,14 @@ bool EffectsHandlerImpl::loadScriptedEffect(const QString& name, KService *servi kDebug(1212) << "X-Plasma-MainScript not set"; return false; } - const QString scriptFile = KStandardDirs::locateLocal("data", "kwin/effects/" + name + '/' + scriptName); + const QString scriptFile = KStandardDirs::locate("data", "kwin/effects/" + name + "/contents/" + scriptName); if (scriptFile.isNull()) { kDebug(1212) << "Could not locate the effect script"; return false; } ScriptedEffect *effect = ScriptedEffect::create(name, scriptFile); if (!effect) { + kDebug(1212) << "Could not initialize scripted effect: " << name; return false; } effect_order.insert(service->property("X-KDE-Ordering").toInt(), EffectPair(name, effect)); diff --git a/scripting/scriptedeffect.cpp b/scripting/scriptedeffect.cpp index f30daf7a97..978ecb2764 100644 --- a/scripting/scriptedeffect.cpp +++ b/scripting/scriptedeffect.cpp @@ -138,6 +138,7 @@ bool ScriptedEffect::init(const QString &effectName, const QString &pathToScript { QFile scriptFile(pathToScript); if (!scriptFile.open(QIODevice::ReadOnly)) { + kDebug(1212) << "Could not open script file: " << pathToScript; return false; } m_effectName = effectName; @@ -245,7 +246,7 @@ QVariant ScriptedEffect::readConfig(const QString& key) bool ScriptedEffect::loadConfig(const QString& name) { - const QString path = KStandardDirs::locateLocal("data", "kwin/effects/" + m_effectName + "/config/" + name + ".xml"); + const QString path = KStandardDirs::locate("data", "kwin/effects/" + m_effectName + "/contents/config/" + name + ".xml"); if (path.isEmpty()) { return false; }