[vlc-devel] [PATCH 7/9] qml: don't preload About and Player page component

Pierre Lamot pierre at videolabs.io
Fri Aug 28 16:25:54 CEST 2020


---
 modules/gui/qt/dialogs/help/qml/About.qml     |  4 ++++
 .../qt/maininterface/qml/MainInterface.qml    | 24 ++-----------------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/modules/gui/qt/dialogs/help/qml/About.qml b/modules/gui/qt/dialogs/help/qml/About.qml
index 2287ba3c6a..e561932291 100644
--- a/modules/gui/qt/dialogs/help/qml/About.qml
+++ b/modules/gui/qt/dialogs/help/qml/About.qml
@@ -28,6 +28,10 @@ Widgets.NavigableFocusScope {
     id: root
     property alias columnLayout: columnLayout
 
+    onActionCancel: {
+        history.previous()
+    }
+
     AboutModel {
         id: about
     }
diff --git a/modules/gui/qt/maininterface/qml/MainInterface.qml b/modules/gui/qt/maininterface/qml/MainInterface.qml
index ec7f95616f..0002be58ea 100644
--- a/modules/gui/qt/maininterface/qml/MainInterface.qml
+++ b/modules/gui/qt/maininterface/qml/MainInterface.qml
@@ -24,8 +24,6 @@ import org.videolan.vlc 0.1
 import "qrc:///widgets/" as Widgets
 import "qrc:///style/"
 
-import "qrc:///player/" as Player
-import "qrc:///about/" as AB
 import "qrc:///dialogs/" as DG
 import "qrc:///playlist/" as PL
 import QtQuick.Window 2.11
@@ -77,29 +75,11 @@ Rectangle {
         }
     }
 
-    Component {
-        id: audioplayerComp
-        Player.Player {
-            focus: true
-        }
-    }
-
-    Component {
-        id: aboutComp
-        AB.About {
-            focus: true
-            onActionCancel: {
-                console.log("onActionCancel")
-                history.previous()
-            }
-        }
-    }
-
     readonly property var pageModel: [
-        { name: "about", component: aboutComp },
+        { name: "about", url: "qrc:///about/About.qml" },
         { name: "mc", url: "qrc:///medialibrary/MainDisplay.qml" },
         { name: "playlist", url: "qrc:///playlist/PlaylistMainView.qml" },
-        { name: "player", component: audioplayerComp },
+        { name: "player", url:"qrc:///player/Player.qml" },
     ]
 
     function loadCurrentHistoryView() {
-- 
2.25.1



More information about the vlc-devel mailing list