[vlc-commits] qml: allow items loaded in StackViewExt to provide a dismiss function for cleanup before unloading
Pierre Lamot
git at videolan.org
Mon Oct 14 11:59:46 CEST 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Oct 10 18:15:47 2019 +0200| [e1808e5b1dc643ec786370a224ae1261f47ed129] | committer: Jean-Baptiste Kempf
qml: allow items loaded in StackViewExt to provide a dismiss function for cleanup before unloading
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e1808e5b1dc643ec786370a224ae1261f47ed129
---
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()
More information about the vlc-commits
mailing list