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 @@
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
......
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