summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/qdeclarativeaudio.cpp
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-03-19 02:56:15 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-03-19 05:31:59 (GMT)
commit0d4572595698502e04f491bfea3e16bb1851b645 (patch)
tree3e5545fdf75012a6f899bf4839f4b1556ab9e7e2 /src/imports/multimedia/qdeclarativeaudio.cpp
parentabf09f87af8f57f670904ff25a626d19ec11120b (diff)
downloadQt-0d4572595698502e04f491bfea3e16bb1851b645.zip
Qt-0d4572595698502e04f491bfea3e16bb1851b645.tar.gz
Qt-0d4572595698502e04f491bfea3e16bb1851b645.tar.bz2
Fix; QML Video item is sensitive to property assignment order
Task-number: QTBUG-8605 Reviewed-by: Andrew den Exter
Diffstat (limited to 'src/imports/multimedia/qdeclarativeaudio.cpp')
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index 40133ee..39223dc 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -77,7 +77,6 @@ void QDeclarativeAudio::_q_error(int errorCode, const QString &errorString)
QDeclarativeAudio::QDeclarativeAudio(QObject *parent)
: QObject(parent)
{
- setObject(this);
}
QDeclarativeAudio::~QDeclarativeAudio()
@@ -94,13 +93,12 @@ QDeclarativeAudio::~QDeclarativeAudio()
*/
void QDeclarativeAudio::play()
-{
- m_playerControl->play();
+{
+ if (m_playerControl == 0)
+ return;
- if (m_paused) {
- m_paused = false;
- emit pausedChanged();
- }
+ setPaused(false);
+ setPlaying(true);
}
/*!
@@ -113,12 +111,11 @@ void QDeclarativeAudio::play()
void QDeclarativeAudio::pause()
{
- m_playerControl->pause();
+ if (m_playerControl == 0)
+ return;
- if (!m_paused && m_state == QMediaPlayer::PausedState) {
- m_paused = true;
- emit pausedChanged();
- }
+ setPaused(true);
+ setPlaying(true);
}
/*!
@@ -131,12 +128,11 @@ void QDeclarativeAudio::pause()
void QDeclarativeAudio::stop()
{
- m_playerControl->stop();
+ if (m_playerControl == 0)
+ return;
- if (m_paused) {
- m_paused = false;
- emit pausedChanged();
- }
+ setPlaying(false);
+ setPaused(false);
}
/*!
@@ -307,6 +303,12 @@ QDeclarativeAudio::Error QDeclarativeAudio::error() const
return Error(m_error);
}
+void QDeclarativeAudio::componentComplete()
+{
+ setObject(this);
+}
+
+
/*!
\qmlproperty string Audio::errorString