summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-11-03 15:54:29 +0100
committerYoann Lopes <yoann.lopes@nokia.com>2011-11-03 15:54:29 +0100
commit8ead54b40e873da5fde5fb95ab54ca599eadf6ec (patch)
tree2856769eb5a416d602fe05a0232a11a61aeacaf9
parent6d36f509fe3cb4e67e58260d536844fb3f60632e (diff)
Push a PlaylistPage to the stack only when it's fully created.
-rw-r--r--qml/PlaylistPage.qml9
-rw-r--r--qml/TracklistPage.qml12
2 files changed, 14 insertions, 7 deletions
diff --git a/qml/PlaylistPage.qml b/qml/PlaylistPage.qml
index 5a2bcbc..cb65fb3 100644
--- a/qml/PlaylistPage.qml
+++ b/qml/PlaylistPage.qml
@@ -99,8 +99,13 @@ Page {
opacity: !spotifySession.offlineMode || modelData.availableOffline ? 1.0 : 0.3
onClicked: {
- if (modelData.trackCount > 0)
- pageStack.push(Qt.resolvedUrl("TracklistPage.qml"), { playlist: modelData })
+ if (modelData.trackCount > 0) {
+ var component = Qt.createComponent("TracklistPage.qml");
+ if (component.status == Component.Ready) {
+ var playlistPage = component.createObject(pageStack, { playlist: modelData });
+ pageStack.push(playlistPage);
+ }
+ }
}
onPressAndHold: { menu.playlist = modelData; menu.open(); }
diff --git a/qml/TracklistPage.qml b/qml/TracklistPage.qml
index ea1a903..d5d277c 100644
--- a/qml/TracklistPage.qml
+++ b/qml/TracklistPage.qml
@@ -102,12 +102,19 @@ Page {
}
}
+ onPlaylistChanged: {
+ tracks.delegate = playlist.type == SpotifyPlaylist.Inbox ? inboxDelegate : trackDelegate
+ tracks.positionViewAtBeginning();
+ }
+
ListView {
id: tracks
property bool showSearchField: false
property bool _movementFromBeginning: false
+ Component.onCompleted: tracks.positionViewAtBeginning();
+
Timer {
id: searchFieldTimer
onTriggered: tracks.showSearchField = false
@@ -141,11 +148,6 @@ Page {
_movementFromBeginning = false;
}
}
-
- Component.onCompleted: {
- tracks.delegate = playlist.type == SpotifyPlaylist.Inbox ? inboxDelegate : trackDelegate
- positionViewAtBeginning();
- }
}
Connections {