Skip to content

Commit 71c1969

Browse files
committed
SBImportOperation actually does take [URL]
We refactored it to take an array of URLs, but SBDatabaseWindow wasn't changed to match it. Crash caught by app store review.
1 parent 2e87879 commit 71c1969

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Submariner/SBDatabaseController.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,8 @@ - (void)updateProgress:(NSTimer *)updatedTimer {
988988

989989
- (void)openAudioFilesPanelDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
990990
if(returnCode == NSModalResponseOK) {
991-
NSArray *files = [panel URLs];
991+
NSArray<NSURL*> *files = [panel URLs];
992992
if(files) {
993-
// SBImportOperation takes NSStrings, not URLs, so map
994-
files = [files valueForKey: @"path"];
995-
996993
[panel orderOut:self];
997994
[NSApp endSheet:panel];
998995

@@ -1006,7 +1003,7 @@ - (void)openAudioFilesPanelDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)ret
10061003
}
10071004

10081005

1009-
- (void)importSheetDidEnd: (NSWindow *)sheet returnCode: (NSInteger)returnCode contextInfo: (NSArray *)choosedFiles {
1006+
- (void)importSheetDidEnd: (NSWindow *)sheet returnCode: (NSInteger)returnCode contextInfo: (NSArray<NSURL*> *)choosedFiles {
10101007

10111008
if(returnCode == NSAlertFirstButtonReturn) {
10121009
if(choosedFiles != nil) {
@@ -1280,7 +1277,7 @@ - (void)displayViewControllerForResource:(SBResource *)resource {
12801277
}
12811278

12821279

1283-
- (BOOL)openImportAlert:(NSWindow *)sender files:(NSArray *)files {
1280+
- (BOOL)openImportAlert:(NSWindow *)sender files:(NSArray<NSURL*> *)files {
12841281
NSAlert *importAlert = [[NSAlert alloc] init];
12851282
[importAlert setMessageText:@"Do you want to copy the imported audio files?"];
12861283
[importAlert setInformativeText: @"The files will copied into the library directory, or have the new library items link to the original files."];

0 commit comments

Comments
 (0)