X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fplaylist.m;h=f9e6e8efd6a3c8b7b65c5e695148eba63f3b3fa8;hb=8a5d95d032dd1d3773858ece1d5efe2f970d6bab;hp=a01e714b37751cdc6718e83385329977192f0ae3;hpb=f2b2e37c04b2921e29daa3260dc696646ad4f10c;p=vlc diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index a01e714b37..f9e6e8efd6 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -258,7 +258,7 @@ attempted_reload = NO; - if( [[o_tc identifier] isEqualToString:@"1"] ) + if( [[o_tc identifier] isEqualToString:@"name"] ) { /* sanity check to prevent the NSString class from crashing */ char *psz_title = input_item_GetTitle( p_item->p_input ); @@ -269,36 +269,37 @@ else { char *psz_name = input_item_GetName( p_item->p_input ); - if( !EMPTY_STR( psz_name ) ) - { + if( psz_name ) o_value = [NSString stringWithUTF8String: psz_name]; - } free( psz_name ); } free( psz_title ); } - else + else if( [[o_tc identifier] isEqualToString:@"artist"] ) { char *psz_artist = input_item_GetArtist( p_item->p_input ); - if( [[o_tc identifier] isEqualToString:@"2"] && !EMPTY_STR( psz_artist ) ) - { + if( psz_artist ) o_value = [NSString stringWithUTF8String: psz_artist]; + free( psz_artist ); + } + else if( [[o_tc identifier] isEqualToString:@"duration"] ) + { + char psz_duration[MSTRTIME_MAX_SIZE]; + mtime_t dur = input_item_GetDuration( p_item->p_input ); + if( dur != -1 ) + { + secstotimestr( psz_duration, dur/1000000 ); + o_value = [NSString stringWithUTF8String: psz_duration]; } - else if( [[o_tc identifier] isEqualToString:@"3"] ) + else + o_value = @"--:--"; + } + else if( [[o_tc identifier] isEqualToString:@"status"] ) + { + if( input_ItemHasErrorWhenReading( p_item->p_input ) ) { - char psz_duration[MSTRTIME_MAX_SIZE]; - mtime_t dur = input_item_GetDuration( p_item->p_input ); - if( dur != -1 ) - { - secstotimestr( psz_duration, dur/1000000 ); - o_value = [NSString stringWithUTF8String: psz_duration]; - } - else - { - o_value = @"--:--"; - } + o_value = [NSImage imageWithWarningIcon]; } - free( psz_artist ); } return o_value; } @@ -351,6 +352,13 @@ return self; } +- (void)dealloc +{ + [o_nodes_array release]; + [o_items_array release]; + [super dealloc]; +} + - (void)awakeFromNib { playlist_t * p_playlist = pl_Yield( VLCIntf );