on xenial help sign in
Don't play empty urls in Notification.qml

Approved by: Mirco Müller, Ricardo Salveti, Ricardo Mendoza

commitc43869f1bc79ec462039928d4f0f7194c1437612 authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 18 Sep 2014, 09:43 (12 years ago) parentb6cc77c7dde7ae
3 files changed+3−3
qml/Notifications/Notification.qml+1−1 tests/mocks/QtMultimedia/audio.cpp+1−1 tests/qmltests/Notifications/tst_Notifications.qml+1−1
qml/Notifications/Notification.qml+1−1
@@ -82,7 +82,7 @@ Item {
8282
8383 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
8484 Component.onCompleted: {
85− if (opacity == 1.0 && hints["suppress-sound"] != "true" && sound.source) {
85+ if (opacity == 1.0 && hints["suppress-sound"] != "true" && sound.source != "") {
8686 sound.play();
8787 }
8888 }
tests/mocks/QtMultimedia/audio.cpp+1−1
@@ -77,7 +77,7 @@ void Audio::pause()
7777
7878void Audio::play()
7979{
80− if (m_playbackState != PlayingState && m_source.isValid()) {
80+ if (m_playbackState != PlayingState) {
8181 m_playbackState = PlayingState;
8282 Q_EMIT playbackStateChanged(m_playbackState);
8383
tests/qmltests/Notifications/tst_Notifications.qml+1−1
@@ -476,7 +476,7 @@ Row {
476476 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
477477
478478 var audioItem = findInvisibleChild(notification, "sound")
479− tryCompare(audioItem, "playbackState", data.hasSound ? Audio.PlayingState : Audio.StoppedState)
479+ compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
480480
481481 if(data.buttonRowVisible) {
482482 var buttonCancel = findChild(buttonRow, "notify_button1")