[vlc-devel] [PATCH 3/3] qml: remove obsolete MultiCoverPreview

Pierre Lamot pierre at videolabs.io
Tue Oct 29 14:47:18 CET 2019


  MultiCoverPreview was used to generate genre thumbnails,
  though the grabToImage function no longer works with recent Qt version
  when qml is in a QQuickWidget. See previous commits for replacement.
---
 modules/gui/qt/Makefile.am                    |  1 -
 .../gui/qt/qml/utils/MultiCoverPreview.qml    | 86 -------------------
 modules/gui/qt/vlc.qrc                        |  1 -
 3 files changed, 88 deletions(-)
 delete mode 100644 modules/gui/qt/qml/utils/MultiCoverPreview.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 63f0c13c62..4a82fa84c8 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -596,7 +596,6 @@ libqt_plugin_la_QML = \
 	gui/qt/qml/utils/MenuExt.qml \
 	gui/qt/qml/utils/MenuItemExt.qml \
 	gui/qt/qml/utils/ListItem.qml \
-	gui/qt/qml/utils/MultiCoverPreview.qml \
 	gui/qt/qml/utils/ExpandGridView.qml \
 	gui/qt/qml/utils/NavigableFocusScope.qml \
 	gui/qt/qml/utils/NavigableCol.qml \
diff --git a/modules/gui/qt/qml/utils/MultiCoverPreview.qml b/modules/gui/qt/qml/utils/MultiCoverPreview.qml
deleted file mode 100644
index 2dc9e3e2c6..0000000000
--- a/modules/gui/qt/qml/utils/MultiCoverPreview.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2019 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * ( at your option ) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-/********************************************************
- * If 2 or 3 items, some cover will be cropped to fit in
- * not square spaces
- * If 1 album : |---------| If 2 albums : |----|----|
- *              |         |               |    |    |
- *              |         |               |    |    |
- *              |         |               |    |    |
- *              |---------|               |----|----|
- * If 3 albums : |----|----| If 4+ albums : |----|----|
- *               |    |    |                |    |    |
- *               |    |----|                |----|----|
- *               |    |    |                |    |    |
- *               |----|----|                |----|----|
- ********************************************************/
-
-import QtQuick 2.11
-import QtQuick.Layouts 1.3
-import org.videolan.medialib 0.1
-import "qrc:///style"
-
-Item {
-    id: root
-    property var albums: undefined
-
-    GridLayout {
-        id: gridCover_id
-
-        anchors.fill: parent
-
-        columns: 2
-        columnSpacing: VLCStyle.margin_xxxsmall
-        rowSpacing: VLCStyle.margin_xxxsmall
-
-        Repeater {
-            model: Math.min(albums.rowCount(), 4)
-
-            /* One cover */
-            Image {
-                id: img
-
-                Layout.rowSpan: albums.rowCount() >= 1 ? 2 : 1
-                Layout.columnSpan: albums.rowCount() === 1 ? 2 : 1
-                Layout.fillHeight: true
-                Layout.fillWidth: true
-                source: albums.data(albums.index(index, 0), MLAlbumModel.ALBUM_COVER) || VLCStyle.noArtAlbum
-                fillMode: Image.PreserveAspectCrop
-                sourceSize: Qt.size(width, height)
-            }
-        }
-    }
-
-    /* "..." label */
-    // If there are more than 4 albums, display "..." to signal there are more
-    Text {
-        id: moreText
-
-        anchors.right: parent.right
-        anchors.bottom: parent.bottom
-
-        text: "..."
-        font.pixelSize: 30
-        color: VLCStyle.colors.text
-        style: Text.Outline
-        styleColor: VLCStyle.colors.bg
-
-        visible: albums.rowCount() >= 4
-    }
-}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index bcf21ae7ed..bb597752ce 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -177,7 +177,6 @@
     </qresource>
     <qresource prefix="/utils">
         <file alias="BusyIndicatorExt.qml">qml/utils/BusyIndicatorExt.qml</file>
-        <file alias="MultiCoverPreview.qml">qml/utils/MultiCoverPreview.qml</file>
         <file alias="GridItem.qml">qml/utils/GridItem.qml</file>
         <file alias="ListItem.qml">qml/utils/ListItem.qml</file>
         <file alias="DrawerExt.qml">qml/utils/DrawerExt.qml</file>
-- 
2.17.1



More information about the vlc-devel mailing list