From 3b7bf0d77be33030bf1edaeea3c0f75c1b42b532 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Mon, 26 Aug 2019 12:03:14 +0200 Subject: [PATCH] Removed unneeded parameters in import API --- MacPass/MPDocumentWindowController.m | 6 ++++-- MacPass/MPPlugin.h | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index fc59375b..5f7e8595 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -297,8 +297,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword); NSOpenPanel *openPanel = NSOpenPanel.openPanel; [importPlugin prepareOpenPanel:openPanel]; [openPanel beginSheetModalForWindow:sheetWindow completionHandler:^(NSModalResponse result) { - KPKTree *importedTree = [importPlugin treeForRunningOpenPanel:openPanel withResponse:result]; - [self.document importTree:importedTree]; + if(result == NSModalResponseOK) { + KPKTree *importedTree = [importPlugin treeForRunningOpenPanel:openPanel]; + [self.document importTree:importedTree]; + } }]; } diff --git a/MacPass/MPPlugin.h b/MacPass/MPPlugin.h index 6ed402d4..1a1e82ac 100644 --- a/MacPass/MPPlugin.h +++ b/MacPass/MPPlugin.h @@ -139,10 +139,9 @@ FOUNDATION_EXPORT NSString *const MPPluginDescriptionInfoDictionaryKey; For example, if a CVS import might need user input on how to handle the parsed files this is the place to show it. @param panel The open panel used for selecting what file(s) to import - @param response The response for of the user for running the panel @return The KPKTree constructed from the selected input file(s) */ -- (KPKTree *)treeForRunningOpenPanel:(NSOpenPanel *)panel withResponse:(NSModalResponse)response; +- (KPKTree *)treeForRunningOpenPanel:(NSOpenPanel *)panel; @end #pragma mark Deprecated