From 435961b49822fe4ae22e14c2f7410c2604a76454 Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Thu, 3 Dec 2009 20:07:37 +0000 Subject: [PATCH] fix in the fix: use takeAnimation instead of takeAnimationAt svn path=/trunk/KDE/kdelibs/; revision=1058014 --- animations/animation.cpp | 2 ++ animations/animationgroup.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/animations/animation.cpp b/animations/animation.cpp index 284f07b75..065a00981 100644 --- a/animations/animation.cpp +++ b/animations/animation.cpp @@ -125,10 +125,12 @@ void Animation::updateCurrentTime(int currentTime) if (d->forwards == QAbstractAnimation::Forward) { if (currentTime == duration()) { d->dirtyFlag = false; + emit finished(); } } else if (d->forwards == QAbstractAnimation::Backward) { if (currentTime == 0) { d->dirtyFlag = false; + emit finished(); } } diff --git a/animations/animationgroup.cpp b/animations/animationgroup.cpp index 1576ac4c1..9bb4f2cac 100644 --- a/animations/animationgroup.cpp +++ b/animations/animationgroup.cpp @@ -48,6 +48,7 @@ AnimationGroup::AnimationGroup(QObject* parent) d(new AnimationGroupPrivate) { d->anim = new QSequentialAnimationGroup(this); + connect(d->anim, SIGNAL(finished()), this, SIGNAL(finished())); } AnimationGroup::~AnimationGroup() @@ -75,11 +76,13 @@ void AnimationGroup::setParallel(bool parallel) newGroup = new QSequentialAnimationGroup(this); while (d->anim->animationCount()) { - newGroup->addAnimation(d->anim->takeAnimationAt(0)); + newGroup->addAnimation(d->anim->takeAnimation(0)); } + disconnect(d->anim, SIGNAL(finished()), this, SIGNAL(finished())); delete d->anim; d->anim = newGroup; + connect(d->anim, SIGNAL(finished()), this, SIGNAL(finished())); } bool AnimationGroup::isParallel() const @@ -138,10 +141,12 @@ void AnimationGroup::updateCurrentTime(int currentTime) if (d->forwards == QAbstractAnimation::Forward) { if (currentTime == duration()) { d->dirtyFlag = false; + emit finished(); } } else if (d->forwards == QAbstractAnimation::Backward) { if (currentTime == 0) { d->dirtyFlag = false; + emit finished(); } } }