able to fetch property animation; was missing in js relative to the c++
svn path=/trunk/KDE/kdebase/runtime/; revision=1073568
This commit is contained in:
parent
1ea98c3161
commit
c3b9c61da1
@ -427,7 +427,8 @@ QScriptValue SimpleJavaScriptApplet::animation(QScriptContext *context, QScriptE
|
|||||||
populateAnimationsHash();
|
populateAnimationsHash();
|
||||||
QString animName = context->argument(0).toString().toLower();
|
QString animName = context->argument(0).toString().toLower();
|
||||||
const bool isPause = animName == "pause";
|
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));
|
return context->throwError(i18n("%1 is not a known animation type", animName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,6 +437,9 @@ QScriptValue SimpleJavaScriptApplet::animation(QScriptContext *context, QScriptE
|
|||||||
if (isPause) {
|
if (isPause) {
|
||||||
QPauseAnimation *pause = new QPauseAnimation(parent);
|
QPauseAnimation *pause = new QPauseAnimation(parent);
|
||||||
return engine->newQObject(pause);
|
return engine->newQObject(pause);
|
||||||
|
} else if (isProperty) {
|
||||||
|
QPropertyAnimation *propertyAnim = new QPropertyAnimation(parent);
|
||||||
|
return engine->newQObject(propertyAnim);
|
||||||
} else {
|
} else {
|
||||||
Plasma::Animation *anim = Plasma::Animator::create(s_animationDefs.value(animName), parent);
|
Plasma::Animation *anim = Plasma::Animator::create(s_animationDefs.value(animName), parent);
|
||||||
if (anim) {
|
if (anim) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user