From 444e8812eec42abd2dcc5e47826f9a4793a34f66 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 25 Mar 2010 10:32:03 +1000 Subject: Rename loopCount to loops, in line with other declarative elements. Reviewed-by: Dmytro Poplavskiy --- src/multimedia/effects/qsoundeffect.cpp | 10 +++++----- src/multimedia/effects/qsoundeffect_p.h | 8 ++++---- tests/auto/qsoundeffect/tst_qsoundeffect.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/multimedia/effects/qsoundeffect.cpp b/src/multimedia/effects/qsoundeffect.cpp index 53cad8e..ed9ab3f 100644 --- a/src/multimedia/effects/qsoundeffect.cpp +++ b/src/multimedia/effects/qsoundeffect.cpp @@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlproperty int SoundEffect::loopCount + \qmlproperty int SoundEffect::loops This property provides a way to control the number of times to repeat the sound on each play(). */ @@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlsignal SoundEffect::loopCountChanged() + \qmlsignal SoundEffect::loopsChanged() This handler is called when the number of loops has changes. */ @@ -150,18 +150,18 @@ void QSoundEffect::setSource(const QUrl &url) emit sourceChanged(); } -int QSoundEffect::loopCount() const +int QSoundEffect::loops() const { return d->loopCount(); } -void QSoundEffect::setLoopCount(int loopCount) +void QSoundEffect::setLoops(int loopCount) { if (d->loopCount() == loopCount) return; d->setLoopCount(loopCount); - emit loopCountChanged(); + emit loopsChanged(); } int QSoundEffect::volume() const diff --git a/src/multimedia/effects/qsoundeffect_p.h b/src/multimedia/effects/qsoundeffect_p.h index ec6a2f7..05207a0 100644 --- a/src/multimedia/effects/qsoundeffect_p.h +++ b/src/multimedia/effects/qsoundeffect_p.h @@ -67,7 +67,7 @@ class Q_MULTIMEDIA_EXPORT QSoundEffect : public QObject { Q_OBJECT Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(int loopCount READ loopCount WRITE setLoopCount NOTIFY loopCountChanged) + Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopsChanged) Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) @@ -78,8 +78,8 @@ public: QUrl source() const; void setSource(const QUrl &url); - int loopCount() const; - void setLoopCount(int loopCount); + int loops() const; + void setLoops(int loopCount); int volume() const; void setVolume(int volume); @@ -89,7 +89,7 @@ public: Q_SIGNALS: void sourceChanged(); - void loopCountChanged(); + void loopsChanged(); void volumeChanged(); void mutedChanged(); diff --git a/tests/auto/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/qsoundeffect/tst_qsoundeffect.cpp index b918816..e76a4c5 100644 --- a/tests/auto/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/qsoundeffect/tst_qsoundeffect.cpp @@ -72,7 +72,7 @@ void tst_QSoundEffect::initTestCase() sound = new QSoundEffect; QVERIFY(sound->source().isEmpty()); - QVERIFY(sound->loopCount() == 1); + QVERIFY(sound->loops() == 1); QVERIFY(sound->volume() == 100); QVERIFY(sound->isMuted() == false); #endif @@ -99,10 +99,10 @@ void tst_QSoundEffect::testSource() void tst_QSoundEffect::testLooping() { #ifndef QT_MULTIMEDIA_QMEDIAPLAYER - QSignalSpy readSignal(sound, SIGNAL(loopCountChanged())); + QSignalSpy readSignal(sound, SIGNAL(loopsChanged())); - sound->setLoopCount(5); - QCOMPARE(sound->loopCount(),5); + sound->setLoops(5); + QCOMPARE(sound->loops(),5); sound->play(); -- cgit v0.12