← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/music-app/fix-1470755-playlist-0-append into lp:music-app

 

Andrew Hayzen has proposed merging lp:~ahayzen/music-app/fix-1470755-playlist-0-append into lp:music-app.

Commit message:
* Ensure that the lowest rebuild index is retained
* Use an alias to set the model as the CardView knows about preloading now

Requested reviews:
  Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot): continuous-integration
  Music App Developers (music-app-dev)
Related bugs:
  Bug #1470755 in Ubuntu Music App: "There is a song in the playlist but the cover of this playlist says that there is 0 songs"
  https://bugs.launchpad.net/music-app/+bug/1470755

For more details, see:
https://code.launchpad.net/~ahayzen/music-app/fix-1470755-playlist-0-append/+merge/263707

* Ensure that the lowest rebuild index is retained
* Use an alias to set the model as the CardView knows about preloading now
-- 
Your team Music App Developers is requested to review the proposed merge of lp:~ahayzen/music-app/fix-1470755-playlist-0-append into lp:music-app.
=== modified file 'app/components/ColumnFlow.qml'
--- app/components/ColumnFlow.qml	2015-06-07 12:35:42 +0000
+++ app/components/ColumnFlow.qml	2015-07-02 18:17:23 +0000
@@ -492,7 +492,12 @@
 
     function setDelayRebuildIndex(index)
     {
-        if (delayRebuildIndex === -1 || index < lastIndex) {
+        // Only update the delay index if it isn't set (-1) or
+        //
+        // is within the size of the model (lastIndex)
+        // and is lower than the current delayed index
+        if (delayRebuildIndex === -1 ||
+                (index < delayRebuildIndex && index < lastIndex)) {
             delayRebuildIndex = index
         }
     }

=== modified file 'app/components/Flickables/CardView.qml'
--- app/components/Flickables/CardView.qml	2015-05-03 16:22:31 +0000
+++ app/components/Flickables/CardView.qml	2015-07-02 18:17:23 +0000
@@ -35,17 +35,11 @@
     property alias delegate: flow.delegate
     property var getter
     property alias header: headerLoader.sourceComponent
-    property var model: flow.model
+    property alias model: flow.model
     property real itemWidth: units.gu(15)
 
     onGetterChanged: flow.getter = getter  // cannot use alias to set a function (must be var)
 
-    onVisibleChanged: {
-        if (visible) {  // only load model once CardView is visible
-            flow.model = model
-        }
-    }
-
     Loader {
         id: headerLoader
         visible: sourceComponent !== undefined