[vlc-commits] qml: play proper item via playlist contextmenu

Fatih Uzunoglu git at videolan.org
Tue Aug 18 17:15:00 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Tue Jul 14 21:16:15 2020 +0300| [55b4c6ad6ffaca3beb5ec298ad4b0ff18bcd3d15] | committer: Pierre Lamot

qml: play proper item via playlist contextmenu

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55b4c6ad6ffaca3beb5ec298ad4b0ff18bcd3d15
---

 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()
                             }
                         }



More information about the vlc-commits mailing list