catch an edge condition where propAnim isn't created on fade out

BUG:230159

svn path=/trunk/KDE/kdelibs/; revision=1101747
This commit is contained in:
Aaron J. Seigo 2010-03-10 20:26:17 +00:00
parent 78201bdf2c
commit bfe45534fc

View File

@ -963,16 +963,18 @@ void AppletHandle::startFading(FadeType anim, const QPointF &hoverPos, bool pres
time *= m_opacity;
}
propAnim->setStartValue(0);
propAnim->setEndValue(1);
propAnim->setDuration(time);
if (propAnim) {
propAnim->setStartValue(0);
propAnim->setEndValue(1);
propAnim->setDuration(time);
}
m_animType = anim;
//kDebug() << "animating for " << time << "ms";
if (m_animType == FadeIn) {
propAnim->setDirection(QAbstractAnimation::Forward);
propAnim->start();
} else {
} else if (propAnim) {
propAnim->setDirection(QAbstractAnimation::Backward);
propAnim->start(QAbstractAnimation::DeleteWhenStopped);
}