diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index c46dab6b6..fec874902 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -28,8 +28,21 @@ NSControlSize s = NSControlSizeSmall; NSFont *f = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:s]]; // NSFont *bf = [[NSFontManager sharedFontManager] convertFont:f toHaveTrait:NSBoldFontMask]; + + NSArray *columns = [[NSSet setWithArray:[self tableColumns]] allObjects]; + + if ([columns count] < [[self tableColumns] count]) { + // borkage in saved state + NSArray *borkCols = [[self tableColumns] copy]; + for (NSTableColumn *col in borkCols) { + [self removeTableColumn:col]; + } + for (NSTableColumn *col in columns) { + [self addTableColumn:col]; + } + } - for (NSTableColumn *col in [self tableColumns]) { + for (NSTableColumn *col in columns) { [[col dataCell] setControlSize:s]; [[col dataCell] setFont:f]; } @@ -57,7 +70,7 @@ int visibleTableColumns = 0; int menuIndex = 0; - for (NSTableColumn *col in [[self tableColumns] sortedArrayUsingDescriptors:sortDescriptors]) { + for (NSTableColumn *col in [columns sortedArrayUsingDescriptors:sortDescriptors]) { NSString *title; if ([[col identifier] isEqualToString:@"status"]) { title = @"Status"; @@ -82,7 +95,7 @@ } if (visibleTableColumns == 0) { - for (NSTableColumn *col in [self tableColumns]) { + for (NSTableColumn *col in columns) { [col setHidden:NO]; } }