From 399cf44d456fe8279777a09d70072cc00201bc9e Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 13 Jan 2021 15:12:54 +0100 Subject: [PATCH] Clarified things to do to get async saving to work --- MacPass/MPDocument.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index ba5a2f41..97349f0b 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -147,6 +147,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou [self addWindowController:windowController]; } +/* +- (BOOL)canAsynchronouslyWriteToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation { + return YES; +} + */ + - (BOOL)checkAutosavingSafetyAndReturnError:(NSError **)outError { if(![super checkAutosavingSafetyAndReturnError:outError]) { return NO; // default checking has found an error! @@ -202,6 +208,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou } return nil; // We do not know what version to save! } + + // FIXME: add [self unblockUserInteraction] to enable async save in background! + // this requires a "snapshot" of the tree to be made and stored! return [self.tree encryptWithKey:self.compositeKey format:format error:outError]; }