[vlc-devel] [VLC 3.x 01/11] macosx: Use for-in for table column iteration

Marvin Scholz epirat07 at gmail.com
Mon Aug 31 16:04:07 CEST 2020


Hi,

I tested these changes on 10.7 and there is no partial availability 
warning
or anything like that either, so I believe it works fine on all
macOS versions we support.

On 31 Aug 2020, at 16:00, Felix Paul K├╝hne wrote:

> Hello,
>
> Sorry for the late comment on this.
>
> Is this compatible with the legacy 32bit ObjC runtime, especially on 
> Mac OS X 10.7?
>
> Cheers,
>
> Felix
>
>> On 26. Aug 2020, at 00:50, Marvin Scholz <epirat07 at gmail.com> wrote:
>>
>> (cherry picked from commit 691e51a4d3ba423b34e3ba6a7297a1960096db62)
>> Signed-off-by: Marvin Scholz <epirat07 at gmail.com>
>> ---
>> modules/gui/macosx/VLCPlaylist.m | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/modules/gui/macosx/VLCPlaylist.m 
>> b/modules/gui/macosx/VLCPlaylist.m
>> index a6226de496..135c50c141 100644
>> --- a/modules/gui/macosx/VLCPlaylist.m
>> +++ b/modules/gui/macosx/VLCPlaylist.m
>> @@ -202,18 +202,18 @@ - 
>> (void)setPlaylistHeaderView:(NSTableHeaderView * 
>> __nullable)playlistHeaderView
>>     [self setupPlaylistTableColumnsForMenu:[[[VLCMain sharedInstance] 
>> mainMenu] playlistTableColumnsMenu]];
>>
>>     NSArray * columnArray = [[NSUserDefaults standardUserDefaults] 
>> arrayForKey:@"PlaylistColumnSelection"];
>> -    NSUInteger columnCount = [columnArray count];
>> -    NSString * column;
>>
>> -    for (NSUInteger i = 0; i < columnCount; i++) {
>> -        column = [[columnArray objectAtIndex:i] firstObject];
>> -        if ([column isEqualToString:@"status"])
>> +    for (NSArray *column in columnArray) {
>> +        NSString *columnName = column[0];
>> +        NSNumber *columnWidth = column[1];
>> +
>> +        if ([columnName isEqualToString:@"status"])
>>             continue;
>>
>> -        if(![self setPlaylistColumnTableState: NSOnState 
>> forColumn:column])
>> +        if(![self setPlaylistColumnTableState: NSOnState 
>> forColumn:columnName])
>>             continue;
>>
>> -        [[_outlineView tableColumnWithIdentifier: column] setWidth: 
>> [[[columnArray objectAtIndex:i] objectAtIndex:1] floatValue]];
>> +        [[_outlineView tableColumnWithIdentifier: columnName] 
>> setWidth: [columnWidth floatValue]];
>>     }
>> }
>>
>> -- 
>> 2.24.3 (Apple Git-128)
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list