[vlc-commits] qml: integrate new SortControl to playlist

Fatih Uzunoglu git at videolan.org
Thu Oct 15 10:32:41 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Oct  9 19:56:31 2020 +0300| [948680ca1f7fa46b31cdee9aa660a3952692d784] | committer: Pierre Lamot

qml: integrate new SortControl to playlist

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

 modules/gui/qt/playlist/qml/PlaylistToolbar.qml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
index 408f692f7f..0a10abcb97 100644
--- a/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
@@ -95,10 +95,13 @@ Widgets.NavigableFocusScope {
                     { text: i18n.qtr("Rating"),           criteria: PlaylistControllerModel.SORT_KEY_RATIN },
                 ]
                 textRole: "text"
-
+                criteriaRole: "criteria"
+                
                 listWidth: VLCStyle.widthSortBox
                 onSortSelected: {
-                    mainPlaylistController.sort(modelData.criteria, PlaylistControllerModel.SORT_ORDER_ASC)
+                    if (modelData.criteria !== sortKey)
+                        mainPlaylistController.setSortOrder(PlaylistControllerModel.SORT_ORDER_ASC)
+                    mainPlaylistController.setSortKey(modelData.criteria)
                 }
 
                 Keys.priority: Keys.AfterItem
@@ -106,6 +109,9 @@ Widgets.NavigableFocusScope {
                 navigationParent: playlistToolbar
 
                 _colors: playlistToolbar._colors
+
+                sortOrder: mainPlaylistController.sortOrder
+                sortKey: mainPlaylistController.sortKey
             }
 
             Widgets.IconToolButton {



More information about the vlc-commits mailing list