From 7c9ff56f2f828410efee049ae01e712dc24aaa77 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 8 Oct 2013 17:26:16 +0200 Subject: [PATCH] Remove unnecessary warning in QMediaPlaylistNavigator. Task-number: QTBUG-33862 Change-Id: Ie74e649ebb5819ccf6300492bdce2a0046b87f02 Reviewed-by: Friedemann Kleint --- src/multimedia/playback/qmediaplaylistnavigator.cpp | 4 +--- tests/auto/unit/qmediaplaylist/tst_qmediaplaylist.cpp | 1 - .../auto/unit/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp | 4 +--- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/multimedia/playback/qmediaplaylistnavigator.cpp b/src/multimedia/playback/qmediaplaylistnavigator.cpp index 132d3ec..e6b1690 100644 --- a/src/multimedia/playback/qmediaplaylistnavigator.cpp +++ b/src/multimedia/playback/qmediaplaylistnavigator.cpp @@ -433,10 +433,8 @@ void QMediaPlaylistNavigator::jump(int position) { Q_D(QMediaPlaylistNavigator); - if (position<-1 || position>=d->playlist->mediaCount()) { - qWarning() << "QMediaPlaylistNavigator: Jump outside playlist range"; + if (position < -1 || position >= d->playlist->mediaCount()) position = -1; - } if (position != -1) d->lastValidPos = position; diff --git a/tests/auto/unit/qmediaplaylist/tst_qmediaplaylist.cpp b/tests/auto/unit/qmediaplaylist/tst_qmediaplaylist.cpp index b3fba20..aa8645d 100644 --- a/tests/auto/unit/qmediaplaylist/tst_qmediaplaylist.cpp +++ b/tests/auto/unit/qmediaplaylist/tst_qmediaplaylist.cpp @@ -276,7 +276,6 @@ void tst_QMediaPlaylist::currentItem() QCOMPARE(playlist.previousIndex(), 0); QCOMPARE(playlist.previousIndex(2), -1); - QTest::ignoreMessage(QtWarningMsg, "QMediaPlaylistNavigator: Jump outside playlist range "); playlist.setCurrentIndex(2); QCOMPARE(playlist.currentIndex(), -1); diff --git a/tests/auto/unit/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp b/tests/auto/unit/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp index 6d9ef29..b0f7d8b 100644 --- a/tests/auto/unit/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp +++ b/tests/auto/unit/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp @@ -115,8 +115,7 @@ void tst_QMediaPlaylistNavigator::linearPlayback() QMediaPlaylistNavigator navigator(&playlist); navigator.setPlaybackMode(QMediaPlaylist::Sequential); - QTest::ignoreMessage(QtWarningMsg, "QMediaPlaylistNavigator: Jump outside playlist range "); - navigator.jump(0);//it's ok to have warning here + navigator.jump(0); QVERIFY(navigator.currentItem().isNull()); QCOMPARE(navigator.currentIndex(), -1); @@ -169,7 +168,6 @@ void tst_QMediaPlaylistNavigator::loopPlayback() QMediaPlaylistNavigator navigator(&playlist); navigator.setPlaybackMode(QMediaPlaylist::Loop); - QTest::ignoreMessage(QtWarningMsg, "QMediaPlaylistNavigator: Jump outside playlist range "); navigator.jump(0); QVERIFY(navigator.currentItem().isNull()); QCOMPARE(navigator.currentIndex(), -1); -- 2.7.4