[vlc-commits] qml: use cover attribute from genre model

Pierre Lamot git at videolan.org
Thu Oct 31 00:54:53 CET 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Oct 29 14:47:17 2019 +0100| [5c44d22d458f7fb21bf0d113c16568ab7afa58d8] | committer: Jean-Baptiste Kempf

qml: use cover attribute from genre model

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c44d22d458f7fb21bf0d113c16568ab7afa58d8
---

 .../gui/qt/qml/mediacenter/MusicGenresDisplay.qml  | 33 ++++------------------
 1 file changed, 6 insertions(+), 27 deletions(-)

diff --git a/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
index 7569fa3f08..8bc53e1919 100644
--- a/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
@@ -48,11 +48,11 @@ Utils.NavigableFocusScope {
                 width: root.width
                 height: VLCStyle.icon_normal + VLCStyle.margin_small
 
-                cover:  Utils.MultiCoverPreview {
-                    albums: MLAlbumModel {
-                        ml: medialib
-                        parentId: model.id
-                    }
+                cover: Image {
+                    id: cover_obj
+                    fillMode: Image.PreserveAspectFit
+                    source: model.cover || VLCStyle.noArtAlbum
+                    sourceSize: Qt.size(width, height)
                 }
 
                 line1: (model.name || "Unknown genre")+" - "+model.nb_tracks+" tracks"
@@ -115,7 +115,7 @@ Utils.NavigableFocusScope {
             delegate: AudioGridItem {
                 id: gridItem
 
-                image: VLCStyle.noArtAlbum
+                image: model.cover || VLCStyle.noArtAlbum
                 title: model.name || "Unknown genre"
                 subtitle: ""
                 //selected: element.DelegateModel.inSelected
@@ -129,27 +129,6 @@ Utils.NavigableFocusScope {
                 onItemDoubleClicked: {
                     history.push(["mc", "music", "albums", { parentId: model.id } ], History.Go)
                 }
-
-                //replace image with a mutlicovers preview
-                Utils.MultiCoverPreview {
-                    id: multicover
-                    visible: false
-                    width: VLCStyle.cover_normal
-                    height: VLCStyle.cover_normal
-
-                    albums: MLAlbumModel {
-                        ml: medialib
-                        parentId: model.id
-                    }
-                }
-
-                Component.onCompleted: {
-                    multicover.grabToImage(function(result) {
-                        gridItem.sourceSize = undefined
-                        gridItem.image = result.url
-                        //multicover.destroy()
-                    })
-                }
             }
 
             focus: true



More information about the vlc-commits mailing list