[vlc-commits] macosx: Ensure title item is always added to table
    Marvin Scholz 
    git at videolan.org
       
    Sat Aug 18 01:06:08 CEST 2018
    
    
  
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Aug 18 01:05:38 2018 +0200| [2125f01b0b0aaf8ca882c6287cb66c4cdf38f6ae] | committer: Marvin Scholz
macosx: Ensure title item is always added to table
Previously it was possible that the table ended up without the title
item in some rare cases and impossible for the user to enable it again
in the menu.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2125f01b0b0aaf8ca882c6287cb66c4cdf38f6ae
---
 modules/gui/macosx/VLCPlaylist.m | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 61a0e8788b..170492b126 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -202,6 +202,8 @@
 
     NSArray *columnArray = [[NSUserDefaults standardUserDefaults] arrayForKey:@"PlaylistColumnSelection"];
 
+    BOOL hasTitleItem = NO;
+
     for (NSArray *column in columnArray) {
         NSString *columnName = column[0];
         NSNumber *columnWidth = column[1];
@@ -209,11 +211,20 @@
         if ([columnName isEqualToString:@"status"])
             continue;
 
+        // Memorize if we custom set always-enabled title item
+        if ([columnName isEqualToString:TITLE_COLUMN]) {
+            hasTitleItem = YES;
+        }
+
         if(![self setPlaylistColumnTableState: NSOnState forColumn:columnName])
             continue;
 
         [[_outlineView tableColumnWithIdentifier:columnName] setWidth:[columnWidth floatValue]];
     }
+
+    // Set the always enabled title item if not already done
+    if (!hasTitleItem)
+        [self setPlaylistColumnTableState:NSOnState forColumn:TITLE_COLUMN];
 }
 
 - (void)applicationWillTerminate:(NSNotification *)notification
    
    
More information about the vlc-commits
mailing list