Merge lp:~ahayzen/music-app/remix-defer-cardview-load into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 705
Merged at revision: 707
Proposed branch: lp:~ahayzen/music-app/remix-defer-cardview-load
Merge into: lp:music-app/remix
Diff against target: 28 lines (+7/-2)
1 file modified
common/CardView.qml (+7/-2)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-defer-cardview-load
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+239777@code.launchpad.net

Commit message

* Only load model once CardView is visible

Description of the change

* Only load model once CardView is visible

This helps with loading the thumbnails for recent faster as it doesn't attempt to load Albums/Artists etc at the same time.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

LGTM, I assume the jenkins failure is a fluke failure.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/CardView.qml'
2--- common/CardView.qml 2014-10-22 17:37:45 +0000
3+++ common/CardView.qml 2014-10-27 22:39:33 +0000
4@@ -32,9 +32,15 @@
5 property alias count: flow.count
6 property alias delegate: flow.delegate
7 property alias header: headerLoader.sourceComponent
8- property alias model: flow.model
9+ property var model: flow.model
10 property real itemWidth: units.gu(15)
11
12+ onVisibleChanged: {
13+ if (visible) { // only load model once CardView is visible
14+ flow.model = model
15+ }
16+ }
17+
18 Loader {
19 id: headerLoader
20 asynchronous: true
21@@ -56,7 +62,6 @@
22 fill: parent
23 margins: units.gu(1)
24 }
25-
26 columns: parseInt(width / itemWidth)
27 }
28 }

Subscribers

People subscribed via source and target branches