[vlc-devel] [PATCH 13/22] qml: reset viewProperties when changing view

Pierre Lamot pierre at videolabs.io
Fri Feb 14 11:23:48 CET 2020


  when changing view, viewProperties from the previous view may be applied
  on the new view.

  for instance, when navigating from genre > album(filtered with genre) >
  tracks the track list ended up filtered by the genre of the previous view
---
 modules/gui/qt/medialibrary/qml/MainDisplay.qml  | 5 ++++-
 modules/gui/qt/medialibrary/qml/MusicDisplay.qml | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index 07c8ba5681..b346d409c2 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -36,7 +36,10 @@ Widgets.NavigableFocusScope {
     property string view: ""
     property var viewProperties: ({})
 
-    onViewChanged: loadView()
+    onViewChanged: {
+        viewProperties = ({})
+        loadView()
+    }
     onViewPropertiesChanged: loadView()
     Component.onCompleted: {
         loadView()
diff --git a/modules/gui/qt/medialibrary/qml/MusicDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicDisplay.qml
index 54363d0450..3254452da2 100644
--- a/modules/gui/qt/medialibrary/qml/MusicDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicDisplay.qml
@@ -37,7 +37,10 @@ Widgets.NavigableFocusScope {
     property var sortModel
     property var contentModel
 
-    onViewChanged: loadView()
+    onViewChanged: {
+        viewProperties = ({})
+        loadView()
+    }
     onViewPropertiesChanged: loadView()
     Component.onCompleted: loadView()
 
-- 
2.17.1



More information about the vlc-devel mailing list