From 5cd72b07d202b487ca42486dfefc99ba2fff0045 Mon Sep 17 00:00:00 2001 From: mae Date: Thu, 8 Jul 2010 07:57:58 +0200 Subject: Optimization: change signal/slot to function call --- src/declarative/util/qdeclarativeanimation.cpp | 4 ++-- src/declarative/util/qdeclarativeanimation_p.h | 6 ++++-- src/declarative/util/qdeclarativebehavior.cpp | 6 +----- src/declarative/util/qdeclarativebehavior_p.h | 1 - 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 6559bd5..bdb9510 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -142,8 +142,8 @@ bool QDeclarativeAbstractAnimation::isRunning() const return d->running; } -// the behavior connects the animation to this slot -void QDeclarativeAbstractAnimation::behaviorControlRunningChanged(bool running) +// the behavior calls this function +void QDeclarativeAbstractAnimation::notifyRunningChanged(bool running) { Q_D(QDeclarativeAbstractAnimation); if (d->disableUserControl && d->running != running) { diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 2279b0e..59bd465 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -134,10 +134,12 @@ public: private Q_SLOTS: void timelineComplete(); void componentFinalized(); - void behaviorControlRunningChanged(bool running); - private: virtual void setTarget(const QDeclarativeProperty &); + void notifyRunningChanged(bool running); + friend class QDeclarativeBehavior; + + }; class QDeclarativePauseAnimationPrivate; diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index 4480e75..2bb28c3 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -138,10 +138,6 @@ void QDeclarativeBehavior::setAnimation(QDeclarativeAbstractAnimation *animation SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), this, SLOT(qtAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); - connect(this, - SIGNAL(qtAnimationRunningChanged(bool)), - d->animation, - SLOT(behaviorControlRunningChanged(bool))); } } @@ -150,7 +146,7 @@ void QDeclarativeBehavior::qtAnimationStateChanged(QAbstractAnimation::State new { Q_D(QDeclarativeBehavior); if (!d->blockRunningChanged) - emit qtAnimationRunningChanged(newState == QAbstractAnimation::Running); + d->animation->notifyRunningChanged(newState == QAbstractAnimation::Running); } diff --git a/src/declarative/util/qdeclarativebehavior_p.h b/src/declarative/util/qdeclarativebehavior_p.h index a3132d9..9801fb2 100644 --- a/src/declarative/util/qdeclarativebehavior_p.h +++ b/src/declarative/util/qdeclarativebehavior_p.h @@ -83,7 +83,6 @@ public: Q_SIGNALS: void enabledChanged(); - void qtAnimationRunningChanged(bool running); private Q_SLOTS: void componentFinalized(); -- cgit v0.12