[vlc-devel] [PATCH 2/3] qml: MultiCoverPreview: clean up repeater

Alexandre Janniaux ajanni at videolabs.io
Wed Oct 9 19:11:23 CEST 2019


From: Pierre Lamot <pierre at videolabs.io>

albums.get should be removed and the count property is useless.
---
 modules/gui/qt/qml/utils/MultiCoverPreview.qml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/qml/utils/MultiCoverPreview.qml b/modules/gui/qt/qml/utils/MultiCoverPreview.qml
index 5fc3c345bd7..2dc9e3e2c61 100644
--- a/modules/gui/qt/qml/utils/MultiCoverPreview.qml
+++ b/modules/gui/qt/qml/utils/MultiCoverPreview.qml
@@ -33,6 +33,7 @@
 
 import QtQuick 2.11
 import QtQuick.Layouts 1.3
+import org.videolan.medialib 0.1
 import "qrc:///style"
 
 Item {
@@ -49,7 +50,6 @@ Item {
         rowSpacing: VLCStyle.margin_xxxsmall
 
         Repeater {
-            property int count: albums.rowCount()
             model: Math.min(albums.rowCount(), 4)
 
             /* One cover */
@@ -60,7 +60,7 @@ Item {
                 Layout.columnSpan: albums.rowCount() === 1 ? 2 : 1
                 Layout.fillHeight: true
                 Layout.fillWidth: true
-                source: albums.get(index).cover || VLCStyle.noArtAlbum
+                source: albums.data(albums.index(index, 0), MLAlbumModel.ALBUM_COVER) || VLCStyle.noArtAlbum
                 fillMode: Image.PreserveAspectCrop
                 sourceSize: Qt.size(width, height)
             }
-- 
2.23.0



More information about the vlc-devel mailing list