diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-01 00:34:28 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-01 00:34:28 (GMT) |
commit | c3a2d9f58c2dc5168a64b3934f41e8503f2e11fd (patch) | |
tree | 560f51017e5e33c1cd3e40817c13ec79548e472e /src/declarative | |
parent | ac79a86a2ac154492025e803045316a01d69470e (diff) | |
parent | 27e55ed231f2afe5a775c3ea92f2ef4bf1f6a26d (diff) | |
download | Qt-c3a2d9f58c2dc5168a64b3934f41e8503f2e11fd.zip Qt-c3a2d9f58c2dc5168a64b3934f41e8503f2e11fd.tar.gz Qt-c3a2d9f58c2dc5168a64b3934f41e8503f2e11fd.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlsqldatabase.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation_p_p.h | 21 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp index d11e3cb..5a7e94c 100644 --- a/src/declarative/qml/qmlsqldatabase.cpp +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -71,7 +71,7 @@ public: str_forwardOnly = engine->toStringHandle(QLatin1String("forwardOnly")); // not in HTML5 (an optimization) } - QueryFlags queryProperty(const QScriptValue &object, + QueryFlags queryProperty(const QScriptValue &, const QScriptString &name, QueryFlags flags, uint *) { @@ -369,7 +369,7 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng // Incompatible THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch")); } - version = ini.value("Version").toString(); + version = ini.value(QLatin1String("Version")).toString(); } database.setDatabaseName(basename+QLatin1String(".sqlite")); } diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h index cb1c642..326e1c6 100644 --- a/src/declarative/util/qmlanimation_p_p.h +++ b/src/declarative/util/qmlanimation_p_p.h @@ -64,6 +64,7 @@ #include <qml.h> #include <qmlcontext.h> #include <private/qmltimeline_p_p.h> +#include <QDebug> QT_BEGIN_NAMESPACE @@ -94,9 +95,9 @@ class QActionAnimation : public QAbstractAnimation { Q_OBJECT public: - QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped) {} + QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped), running(false) {} QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0) - : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped) {} + : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped), running(false) {} virtual int duration() const { return 0; } void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p) { @@ -111,17 +112,27 @@ protected: virtual void updateState(State newState, State /*oldState*/) { if (newState == Running) { - if (animAction) + if (animAction) { + running = true; animAction->doAction(); + running = false; + if (state() == Stopped && policy == DeleteWhenStopped) { + delete animAction; + animAction = 0; + } + } } else if (newState == Stopped && policy == DeleteWhenStopped) { - delete animAction; - animAction = 0; + if (!running) { + delete animAction; + animAction = 0; + } } } private: QAbstractAnimationAction *animAction; DeletionPolicy policy; + bool running; }; //animates QmlTimeLineValue (assumes start and end values will be reals or compatible) |