From af960b0b382c2b46e7a0f791e8d699083898a0df Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 5 Jan 2022 17:29:27 +0100 Subject: [PATCH] WIP on supporting more than one recent document when OS document history is disabled --- MacPass/MPDocumentController.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MacPass/MPDocumentController.m b/MacPass/MPDocumentController.m index 77754dd2..95f34f99 100644 --- a/MacPass/MPDocumentController.m +++ b/MacPass/MPDocumentController.m @@ -31,6 +31,8 @@ #import "KeePassKit/KeePassKit.h" #import "KPKFormat+MPUTIDetection.h" +#import "NSApplication+MPAdditions.h" + @interface MPDocumentController () @property (strong) IBOutlet NSView *accessoryView; @@ -43,6 +45,14 @@ @implementation MPDocumentController +- (BOOL)hasEditedDocuments { + MPAppDelegate *delegate = NSApp.mp_delegate; + if(delegate.isTerminating) { + // store all open documents once?! + } + return [super hasEditedDocuments]; +} + - (void)beginOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)inTypes completionHandler:(void (^)(NSInteger))completionHandler { self.openPanel = openPanel; if(!self.accessoryView) {