From da7a24738299c5382a4db780e6b143ca059406b2 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 1 Nov 2017 17:34:27 +0100 Subject: [PATCH] Enhanced KDB file handling Locking now stores as KDB internally not just to disk Logging when data loss occurs --- MacPass/MPDocument.m | 8 +++++++- MacPass/MPIconSelectViewController.m | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 2b065261..06776e3e 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -433,7 +433,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou [self.undoManager removeAllActions]; NSError *error; /* TODO let the tree chose the encryption */ - self.encryptedData = [self.tree encryptWithKey:self.compositeKey format:KPKDatabaseFormatKdbx error:&error]; + self.encryptedData = [self.tree encryptWithKey:self.compositeKey format:[MPDocument formatForFileType:self.fileType] error:&error]; if(nil == self.encryptedData && error ) { [self presentError:error]; return; @@ -613,6 +613,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou return nil; // no new Groups in trash } + if([self.fileType isEqualToString:MPKdbDocumentUTI]) { + if([self.tree minimumVersionForAddingEntryToGroup:parent].format == KPKDatabaseFormatKdbx) { + NSLog(@"Warning: Database format does not allow for adding entries to this group!"); + } + } + KPKEntry *newEntry = [self.tree createEntry:parent]; /* setting properties on entries is undoable, but we do not want to record this so disable on creation */ BOOL wasUndoEnabeld = self.undoManager.isUndoRegistrationEnabled; diff --git a/MacPass/MPIconSelectViewController.m b/MacPass/MPIconSelectViewController.m index 0910a289..7d86257a 100644 --- a/MacPass/MPIconSelectViewController.m +++ b/MacPass/MPIconSelectViewController.m @@ -76,7 +76,6 @@ typedef NS_ENUM(NSInteger, MPIconDownloadStatus) { } - (IBAction)downloadIcon:(id)sender { - //self.downloadStatus = MPIconDownloadStatusProgress; KPKNode *node = self.representedObject; if(!node.asEntry) { return;