From b6c5407917d0ed0ac63e10f1a16e5085d3125dde Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 28 Sep 2015 13:41:09 +0200 Subject: [PATCH] Fix .txt import not working. --- Classes/SBDocument.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Classes/SBDocument.m b/Classes/SBDocument.m index e8360fb..18c43d8 100755 --- a/Classes/SBDocument.m +++ b/Classes/SBDocument.m @@ -768,13 +768,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn panel.canChooseDirectories = NO; MP42ChapterTrack *chapters = self.mp4.chapters; + + NSMutableArray *supportedFileFormats = [[MP42FileImporter supportedFileFormats] mutableCopy]; + [supportedFileFormats addObject:@"txt"]; + if (chapters) { - panel.allowedFileTypes = [[MP42FileImporter supportedFileFormats] arrayByAddingObject:@"csv"]; - } - else { - panel.allowedFileTypes = [MP42FileImporter supportedFileFormats]; + [supportedFileFormats addObject:@"csv"]; } + panel.allowedFileTypes = supportedFileFormats; + [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { NSString *fileExtension = panel.URLs.firstObject.pathExtension;