Commit 5a61f0dc authored by Felix Paul Kühne's avatar 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.
parent 5e9ec8ba
...@@ -1417,8 +1417,7 @@ ...@@ -1417,8 +1417,7 @@
return( o_ctx_menu ); return( o_ctx_menu );
} }
- (void)outlineView: (NSOutlineView *)o_tv - (void)outlineView: (NSOutlineView *)o_tv didClickTableColumn:(NSTableColumn *)o_tc
didClickTableColumn:(NSTableColumn *)o_tc
{ {
int i_mode, i_type = 0; int i_mode, i_type = 0;
intf_thread_t *p_intf = VLCIntf; intf_thread_t *p_intf = VLCIntf;
...@@ -1426,9 +1425,21 @@ ...@@ -1426,9 +1425,21 @@
playlist_t *p_playlist = pl_Get( p_intf ); playlist_t *p_playlist = pl_Get( p_intf );
/* Check whether the selected table column header corresponds to a if( [o_identifier isEqualToString:TRACKNUM_COLUMN] )
sortable table column*/ i_mode = SORT_TRACK_NUMBER;
if( !( [o_identifier isEqualToString:TITLE_COLUMN] || [o_identifier isEqualToString:ARTIST_COLUMN] || [o_identifier isEqualToString:DURATION_COLUMN] ) ) 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; return;
if( o_tc_sortColumn == o_tc ) if( o_tc_sortColumn == o_tc )
...@@ -1436,13 +1447,6 @@ ...@@ -1436,13 +1447,6 @@
else else
b_isSortDescending = false; 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 ) if( b_isSortDescending )
i_type = ORDER_REVERSE; i_type = ORDER_REVERSE;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment