moved some methods to MP42FileImporter.

This commit is contained in:
Damiano Galassi authored and Damiano Galassi committed 2015-09-18 08:26:29 +02:00
1 parent cd3f3aab7d
commit 5309d17327
2 files changed
+6 -5

No files matched your search

+4 -3
View File
@@ -23,6 +23,7 @@
#import "SBMediaTagsController.h" #import "SBMediaTagsController.h"
#import <MP42Foundation/MP42File.h> #import <MP42Foundation/MP42File.h>
#import <MP42Foundation/MP42FileImporter.h>
#import <MP42Foundation/MP42Languages.h> #import <MP42Foundation/MP42Languages.h>
#import <MP42Foundation/MP42Utilities.h> #import <MP42Foundation/MP42Utilities.h>
@@ -768,10 +769,10 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
MP42ChapterTrack *chapters = self.mp4.chapters; MP42ChapterTrack *chapters = self.mp4.chapters;
if (chapters) { if (chapters) {
panel.allowedFileTypes = [supportedFileFormat() arrayByAddingObject:@"csv"]; panel.allowedFileTypes = [[MP42FileImporter supportedFileFormats] arrayByAddingObject:@"csv"];
} }
else { else {
panel.allowedFileTypes = supportedFileFormat(); panel.allowedFileTypes = [MP42FileImporter supportedFileFormats];
} }
[panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) { [panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) {
@@ -976,7 +977,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[pathExtension caseInsensitiveCompare: @"nfo"] == NSOrderedSame) { [pathExtension caseInsensitiveCompare: @"nfo"] == NSOrderedSame) {
[self addMetadata:url]; [self addMetadata:url];
} }
else if (isFileFormatSupported(pathExtension)) { else if ([MP42FileImporter canInitWithFileType:pathExtension]) {
[supportedItems addObject:url]; [supportedItems addObject:url];
} }
} }
+2 -2
View File
@@ -16,7 +16,7 @@
#import "SBDocument.h" #import "SBDocument.h"
#import "SBTableView.h" #import "SBTableView.h"
#import <MP42Foundation/MP42Utilities.h> #import <MP42Foundation/MP42FileImporter.h>
static void *SBQueueContex = &SBQueueContex; static void *SBQueueContex = &SBQueueContex;
@@ -530,7 +530,7 @@ static void *SBQueueContex = &SBQueueContex;
panel.allowsMultipleSelection = YES; panel.allowsMultipleSelection = YES;
panel.canChooseFiles = YES; panel.canChooseFiles = YES;
panel.canChooseDirectories = YES; panel.canChooseDirectories = YES;
panel.allowedFileTypes = supportedFileFormat(); panel.allowedFileTypes = [MP42FileImporter supportedFileFormats];
[panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) { [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) { if (result == NSFileHandlingPanelOKButton) {