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

Marvin Scholz epirat07 at gmail.com
Wed Aug 26 00:50:07 CEST 2020


(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)



More information about the vlc-devel mailing list