Fixing javascript animation mapping.

svn path=/trunk/KDE/kdelibs/; revision=1123281
This commit is contained in:
Adenilson Cavalcanti Da Silva 2010-05-05 19:43:45 +00:00
parent f0ea5031fb
commit e6e20afd70
2 changed files with 13 additions and 2 deletions

View File

@ -186,7 +186,7 @@ Plasma::Animation *Animator::create(const QString &anim, QObject *parent)
if (!AnimationScriptEngine::isAnimationRegistered(anim)) {
const QString path = Theme::defaultTheme()->animationPath(anim);
if (path.isEmpty()) {
kError() << "failed to find script file for animation" << anim;
kError() << "************ failed to find script file for animation" << anim;
return 0;
}

View File

@ -397,12 +397,21 @@ void ThemePrivate::processAnimationSettings(const QString &theme, KConfigBase *m
const QString animDir = "desktoptheme/" + theme + "/animations/";
foreach (const QString &path, cg.keyList()) {
QStringList anims = cg.readEntry(path, QStringList());
foreach (const QString &anim, anims) {
if (!animationMapping.contains(anim)) {
animationMapping.insert(animDir + anim, path);
kDebug() << "Registering animation. animDir: " << animDir
<< "\tanim: " << anim
<< "\tpath: " << path << "\t*******\n\n\n";
//key: desktoptheme/default/animations/+ all.js
//value: ZoomAnimation
animationMapping.insert(anim, animDir + path);
} else {
kDebug() << "************Animation already registered!\n\n\n";
}
}
}
}
void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings)
@ -575,6 +584,8 @@ QString Theme::animationPath(const QString &name) const
{
const QString path = d->animationMapping.value(name);
if (path.isEmpty()) {
kError() << "****** FAILED TO FIND IN MAPPING!";
return path;
}