From 0a74f871b21a9b7835fb1a5213bcac22ca1592cc Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 18 Aug 2009 15:17:25 +1000 Subject: Rename filter to targets. --- demos/declarative/flickr/flickr.qml | 2 +- demos/declarative/flickr/flickr2.qml | 2 +- examples/declarative/flowview/flowview.qml | 4 +-- src/declarative/util/qmlanimation.cpp | 45 +++++++----------------------- src/declarative/util/qmlanimation.h | 13 +++------ src/declarative/util/qmlanimation_p.h | 5 ++-- 6 files changed, 20 insertions(+), 51 deletions(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index a8d18fb..af2fda4 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -109,7 +109,7 @@ Item { SequentialAnimation { ParentChangeAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { filter: Wrapper; properties: "z" } + SetPropertyAction { target: Wrapper; properties: "z" } } } ] diff --git a/demos/declarative/flickr/flickr2.qml b/demos/declarative/flickr/flickr2.qml index 5350a36..569f286 100644 --- a/demos/declarative/flickr/flickr2.qml +++ b/demos/declarative/flickr/flickr2.qml @@ -108,7 +108,7 @@ Item { SequentialAnimation { ParentChangeAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - SetPropertyAction { filter: Wrapper; properties: "z" } + SetPropertyAction { target: Wrapper; properties: "z" } } } ] diff --git a/examples/declarative/flowview/flowview.qml b/examples/declarative/flowview/flowview.qml index a3d0ac5..8d1bdf6 100644 --- a/examples/declarative/flowview/flowview.qml +++ b/examples/declarative/flowview/flowview.qml @@ -25,8 +25,8 @@ Rect { fromState: "" ; toState: "rotated" reversible: true SequentialAnimation { - NumberAnimation { filter: [TopBar, BottomBar]; properties: "x,y"; easing: "easeInOutQuad" } - NumberAnimation { filter: [LeftBar, RightBar]; properties: "x,y"; easing: "easeInOutQuad"} + NumberAnimation { targets: [TopBar, BottomBar]; properties: "x,y"; easing: "easeInOutQuad" } + NumberAnimation { targets: [LeftBar, RightBar]; properties: "x,y"; easing: "easeInOutQuad"} } } diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 224f668..ee16fae 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -823,35 +823,10 @@ void QmlRunScriptAction::setScript(const QString &script) emit scriptChanged(script); } -/*! - \qmlproperty QString RunScript::script - This property holds the file containing the script to run. -*/ -QString QmlRunScriptAction::file() const -{ - Q_D(const QmlRunScriptAction); - return d->file; -} - -void QmlRunScriptAction::setFile(const QString &file) -{ - Q_D(QmlRunScriptAction); - if (file == d->file) - return; - d->file = file; - emit fileChanged(file); -} - void QmlRunScriptActionPrivate::execute() { Q_Q(QmlRunScriptAction); QString scriptStr = script; - if (!file.isEmpty()){ - QFile scriptFile(file); - if (scriptFile.open(QIODevice::ReadOnly | QIODevice::Text)){ - scriptStr = QString::fromUtf8(scriptFile.readAll()); - } - } if (!scriptStr.isEmpty()) { QmlExpression expr(qmlContext(q), scriptStr, q); @@ -932,20 +907,20 @@ void QmlSetPropertyAction::setProperties(const QString &p) } /*! - \qmlproperty list SetPropertyAction::filter + \qmlproperty list SetPropertyAction::targets This property holds the items selected to be affected by this animation (all if not set). \sa exclude */ -QList *QmlSetPropertyAction::filter() +QList *QmlSetPropertyAction::targets() { Q_D(QmlSetPropertyAction); - return &d->filter; + return &d->targets; } /*! \qmlproperty list SetPropertyAction::exclude This property holds the items not to be affected by this animation. - \sa filter + \sa targets */ QList *QmlSetPropertyAction::exclude() { @@ -1040,7 +1015,7 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions, QString sPropertyName = action.specifiedProperty; bool same = (obj == sObj); - if ((d->filter.isEmpty() || d->filter.contains(obj) || (!same && d->filter.contains(sObj))) && + if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName))) && (!target() || target() == obj || (!same && target() == sObj))) { @@ -1692,20 +1667,20 @@ void QmlPropertyAnimation::setProperties(const QString &prop) } /*! - \qmlproperty list PropertyAnimation::filter + \qmlproperty list PropertyAnimation::targets This property holds the items selected to be affected by this animation (all if not set). \sa exclude */ -QList *QmlPropertyAnimation::filter() +QList *QmlPropertyAnimation::targets() { Q_D(QmlPropertyAnimation); - return &d->filter; + return &d->targets; } /*! \qmlproperty list PropertyAnimation::exclude This property holds the items not to be affected by this animation. - \sa filter + \sa targets */ QList *QmlPropertyAnimation::exclude() { @@ -1836,7 +1811,7 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, QString sPropertyName = action.specifiedProperty; bool same = (obj == sObj); - if ((d->filter.isEmpty() || d->filter.contains(obj) || (!same && d->filter.contains(sObj))) && + if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName)) || (useType && action.property.propertyType() == d->interpolatorType)) && diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h index 91c1898..ef7842c 100644 --- a/src/declarative/util/qmlanimation.h +++ b/src/declarative/util/qmlanimation.h @@ -163,7 +163,6 @@ class QmlRunScriptAction : public QmlAbstractAnimation Q_DECLARE_PRIVATE(QmlRunScriptAction) Q_PROPERTY(QString script READ script WRITE setScript NOTIFY scriptChanged) - Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged) public: QmlRunScriptAction(QObject *parent=0); @@ -172,11 +171,7 @@ public: QString script() const; void setScript(const QString &); - QString file() const; - void setFile(const QString &); - Q_SIGNALS: - void fileChanged(const QString &); void scriptChanged(const QString &); protected: @@ -190,7 +185,7 @@ class QmlSetPropertyAction : public QmlAbstractAnimation Q_DECLARE_PRIVATE(QmlSetPropertyAction) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* filter READ filter) + Q_PROPERTY(QList* targets READ targets) Q_PROPERTY(QList* exclude READ exclude) Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) @@ -201,7 +196,7 @@ public: QString properties() const; void setProperties(const QString &); - QList *filter(); + QList *targets(); QList *exclude(); QVariant value() const; @@ -250,7 +245,7 @@ class QmlPropertyAnimation : public QmlAbstractAnimation Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged) Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged) Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* filter READ filter) + Q_PROPERTY(QList* targets READ targets) Q_PROPERTY(QList* exclude READ exclude) public: @@ -272,7 +267,7 @@ public: QString properties() const; void setProperties(const QString &); - QList *filter(); + QList *targets(); QList *exclude(); protected: diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index 87d480f..3868255 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -230,7 +230,6 @@ public: void init(); QString script; - QString file; void execute(); @@ -249,7 +248,7 @@ public: void init(); QString properties; - QList filter; + QList targets; QList exclude; QmlNullableValue value; @@ -330,7 +329,7 @@ public: QString easing; QString properties; - QList filter; + QList targets; QList exclude; bool fromSourced; -- cgit v0.12