[vlc-commits] macosx: Ensure title item is always added to table
Marvin Scholz
git at videolan.org
Wed Aug 26 16:28:14 CEST 2020
vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Aug 18 01:05:38 2018 +0200| [0047c38748b4442528b7f0ac313cf0322a661b30] | 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.
(cherry picked from commit 2125f01b0b0aaf8ca882c6287cb66c4cdf38f6ae)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=0047c38748b4442528b7f0ac313cf0322a661b30
---
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 36655f8f27..0f9d00c46d 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -203,6 +203,8 @@
NSArray *columnArray = [[NSUserDefaults standardUserDefaults] arrayForKey:@"PlaylistColumnSelection"];
+ BOOL hasTitleItem = NO;
+
for (NSArray *column in columnArray) {
NSString *columnName = column[0];
NSNumber *columnWidth = column[1];
@@ -210,11 +212,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