[vlc-devel] [PATCH 07/19] qml: play proper item via playlist contextmenu

Fatih Uzunoglu fuzun54 at outlook.com
Wed Aug 12 23:17:14 CEST 2020


---
 modules/gui/qt/playlist/qml/PlaylistListView.qml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index ff4a2c0b7c..03749e2971 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -133,6 +133,7 @@ Widgets.NavigableFocusScope {
         Widgets.MenuExt {
             id: contextMenu
             property alias model: root.plmodel
+            property int itemIndex: -1
             property bool medialibAvailable: false
             closePolicy: Popup.CloseOnReleaseOutside | Popup.CloseOnEscape
 
@@ -142,7 +143,7 @@ Widgets.NavigableFocusScope {
                 icon.width: VLCStyle.icon_small
                 icon.height: VLCStyle.icon_small
                 onTriggered: {
-                    mainPlaylistController.goTo(contextMenu.model.getSelection()[0], true)
+                    mainPlaylistController.goTo(contextMenu.itemIndex, true)
                 }
             }
 
@@ -323,6 +324,7 @@ Widgets.NavigableFocusScope {
                             {
                                 view.forceActiveFocus()
                                 root.plmodel.deselectAll()
+                                contextMenu.itemIndex = -1
                                 contextMenu.popup()
                             }
                             else if ( mouse.button === Qt.LeftButton )
@@ -415,6 +417,7 @@ Widgets.NavigableFocusScope {
 
                             if (button === Qt.RightButton)
                             {
+                                contextMenu.itemIndex = index
                                 contextMenu.popup()
                             }
                         }
-- 
2.25.1



More information about the vlc-devel mailing list