From fa9d62784487ed869a42fa5f2e3e12d7fcc959e4 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 11:18:32 +0000 Subject: [PATCH] able to fetch property animation; was missing in js relative to the c++ svn path=/branches/KDE/4.4/kdebase/runtime/; revision=1073569 --- scriptengines/javascript/simplejavascriptapplet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scriptengines/javascript/simplejavascriptapplet.cpp b/scriptengines/javascript/simplejavascriptapplet.cpp index 6a2200147..b20422d65 100644 --- a/scriptengines/javascript/simplejavascriptapplet.cpp +++ b/scriptengines/javascript/simplejavascriptapplet.cpp @@ -639,7 +639,8 @@ QScriptValue SimpleJavaScriptApplet::animation(QScriptContext *context, QScriptE populateAnimationsHash(); QString animName = context->argument(0).toString().toLower(); const bool isPause = animName == "pause"; - if (!isPause && !s_animationDefs.contains(animName)) { + const bool isProperty = animName == "property"; + if (!isPause && !isProperty && !s_animationDefs.contains(animName)) { return context->throwError(i18n("%1 is not a known animation type", animName)); } @@ -648,6 +649,9 @@ QScriptValue SimpleJavaScriptApplet::animation(QScriptContext *context, QScriptE if (isPause) { QPauseAnimation *pause = new QPauseAnimation(parent); return engine->newQObject(pause); + } else if (isProperty) { + QPropertyAnimation *propertyAnim = new QPropertyAnimation(parent); + return engine->newQObject(propertyAnim); } else { Plasma::Animation *anim = Plasma::Animator::create(s_animationDefs.value(animName), parent); if (anim) {