[vlc-commits] macosx: allow the playlist table to be sorted by Genre, Album and Description

Felix Paul Kühne git at videolan.org
Wed May 30 02:59:02 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed May 30 02:58:43 2012 +0200| [5a61f0dc0465b77182c5dd8cf5997a7b7740a4a5] | committer: Felix Paul Kühne

macosx: allow the playlist table to be sorted by Genre, Album and Description

Note that sorting by Date or Language isn't supported due to limitations of the playlist core.

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

 modules/gui/macosx/playlist.m |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 6c0fab8..ed5a22f 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1417,8 +1417,7 @@
     return( o_ctx_menu );
 }
 
-- (void)outlineView: (NSOutlineView *)o_tv
-                  didClickTableColumn:(NSTableColumn *)o_tc
+- (void)outlineView: (NSOutlineView *)o_tv didClickTableColumn:(NSTableColumn *)o_tc
 {
     int i_mode, i_type = 0;
     intf_thread_t *p_intf = VLCIntf;
@@ -1426,9 +1425,21 @@
 
     playlist_t *p_playlist = pl_Get( p_intf );
 
-    /* Check whether the selected table column header corresponds to a
-       sortable table column*/
-    if( !( [o_identifier isEqualToString:TITLE_COLUMN] || [o_identifier isEqualToString:ARTIST_COLUMN] || [o_identifier isEqualToString:DURATION_COLUMN] ) )
+    if( [o_identifier isEqualToString:TRACKNUM_COLUMN] )
+        i_mode = SORT_TRACK_NUMBER;
+    else if( [o_identifier isEqualToString:TITLE_COLUMN] )
+        i_mode = SORT_TITLE;
+    else if( [o_identifier isEqualToString:ARTIST_COLUMN] )
+        i_mode = SORT_ARTIST;
+    else if( [o_identifier isEqualToString:GENRE_COLUMN] )
+        i_mode = SORT_GENRE;
+    else if( [o_identifier isEqualToString:DURATION_COLUMN] )
+        i_mode = SORT_DURATION;
+    else if( [o_identifier isEqualToString:ALBUM_COLUMN] )
+        i_mode = SORT_ALBUM;
+    else if( [o_identifier isEqualToString:DESCRIPTION_COLUMN] )
+        i_mode = SORT_DESCRIPTION;
+    else
         return;
 
     if( o_tc_sortColumn == o_tc )
@@ -1436,13 +1447,6 @@
     else
         b_isSortDescending = false;
 
-    if( [o_identifier isEqualToString:TITLE_COLUMN] )
-        i_mode = SORT_TITLE;
-    else if( [o_identifier isEqualToString:ARTIST_COLUMN] )
-        i_mode = SORT_ARTIST;
-    else if( [o_identifier isEqualToString:DURATION_COLUMN] )
-        i_mode = SORT_DURATION;
-
     if( b_isSortDescending )
         i_type = ORDER_REVERSE;
     else



More information about the vlc-commits mailing list