From c9679d6e773cd242a8d910aa062743f00ed8e68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bot=C3=B6?= Date: Wed, 5 Oct 2016 10:07:32 +0200 Subject: [PATCH] Fix bug in MediaPlayer with next/prev buttons Using the next/prev buttons in Music app would cause the CurrentTrackScreen to stop reacting to changes from MusicService, so switching song using e.g. Library View wouldn't update CurrentTrackScreen. Change-Id: I4c0405b8d626a512d3d59edf98ec3497553b41a4 Reviewed-by: Nedim Hadzic --- apps/com.pelagicore.music/CurrentTrackScreen.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/com.pelagicore.music/CurrentTrackScreen.qml b/apps/com.pelagicore.music/CurrentTrackScreen.qml index 0ff9ae4..6d659ac 100644 --- a/apps/com.pelagicore.music/CurrentTrackScreen.qml +++ b/apps/com.pelagicore.music/CurrentTrackScreen.qml @@ -66,10 +66,10 @@ UIScreen { anchors.verticalCenter: parent.verticalCenter anchors.verticalCenterOffset: Style.vspan(-1) onClicked: { - if (pathView.currentViewIndex === 0) - pathView.currentViewIndex = MusicProvider.count - 1 + if (MusicProvider.currentIndex === 0) + MusicProvider.currentIndex = MusicProvider.count - 1 else - pathView.currentViewIndex -- + MusicProvider.currentIndex -- } } @@ -84,8 +84,6 @@ UIScreen { currentViewIndex: MusicProvider.currentIndex - onCurrentViewIndexChanged: MusicProvider.currentIndex = pathView.currentViewIndex - delegate: CoverItem { z: PathView.z scale: PathView.scale @@ -105,10 +103,10 @@ UIScreen { anchors.verticalCenter: parent.verticalCenter anchors.verticalCenterOffset: Style.vspan(-1) onClicked: { - if (pathView.currentViewIndex === MusicProvider.count - 1) - pathView.currentViewIndex = 0 + if (MusicProvider.currentIndex === MusicProvider.count - 1) + MusicProvider.currentIndex = 0 else - pathView.currentViewIndex ++ + MusicProvider.currentIndex ++ } } }