[vlc-commits] [Git][videolan/vlc][master] qml: Use 'var' for properties altered by StackView.replace()

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Mon Feb 21 14:51:10 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
35ec60b5 by Benjamin Arnaud at 2022-02-21T14:28:07+00:00
qml: Use 'var' for properties altered by StackView.replace()

When calling StackView.replace() together with custom properties we have to provide
generic types (var, int, string). Otherwise we get 'casting' issues when using
a specific one (like MLItemId). This was causing invalid values to be restored
when navigating between the QML MediaLibrary views.

fix #26629

Co-authored-by: Prince Gupta <guptaprince8832 at gmail.com>

- - - - -


2 changed files:

- modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
- modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
=====================================
@@ -30,9 +30,10 @@ VideoAll {
 
     // Properties
 
-    property int      initialIndex: 0
-    property MLItemId initialId
-    property string   initialTitle
+    // NOTE: We need 'var' for properties altered by StackView.replace()..
+    property int    initialIndex: 0
+    property var    initialId
+    property string initialTitle
 
     // Aliases
 


=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
=====================================
@@ -38,9 +38,10 @@ FocusScope {
 
     readonly property int currentIndex: view.currentIndex
 
-    property int     initialIndex: 0
-    property MLItemId initialId
-    property string  initialName
+    // NOTE: We need 'var' for properties altered by StackView.replace()..
+    property int    initialIndex: 0
+    property var    initialId
+    property string initialName
 
     // NOTE: Specify an optional header for the view.
     property Component header: undefined



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/35ec60b58050f777c3c3bbdcad470dcc35382f89

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/35ec60b58050f777c3c3bbdcad470dcc35382f89
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list