[vlc-devel] [PATCH 45/49] qml: allow items loaded in StackViewExt to provide a dismiss function for cleanup before unloading

Pierre Lamot pierre at videolabs.io
Fri Oct 11 15:18:09 CEST 2019


---
 modules/gui/qt/qml/utils/StackViewExt.qml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/qt/qml/utils/StackViewExt.qml b/modules/gui/qt/qml/utils/StackViewExt.qml
index 19554d09c7..16e93e01d2 100644
--- a/modules/gui/qt/qml/utils/StackViewExt.qml
+++ b/modules/gui/qt/qml/utils/StackViewExt.qml
@@ -54,6 +54,9 @@ StackView {
      */
     function loadView(viewModel, view, viewProperties)
     {
+        if (root.currentItem && root.currentItem.hasOwnProperty("dismiss"))
+            root.currentItem.dismiss()
+
         if (view === _currentView) {
             if (Object.keys(viewProperties).length === 0 && root.currentItem.hasOwnProperty("loadDefaultView") ) {
                 root.currentItem.loadDefaultView()
-- 
2.20.1



More information about the vlc-devel mailing list