Enhanced KDB file handling

Locking now stores as KDB internally not just to disk
Logging when data loss occurs
This commit is contained in:
michael starke
2017-11-01 17:34:27 +01:00
parent 65a3bdc992
commit da7a247382
2 changed files with 7 additions and 2 deletions

View File

@@ -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;

View File

@@ -76,7 +76,6 @@ typedef NS_ENUM(NSInteger, MPIconDownloadStatus) {
}
- (IBAction)downloadIcon:(id)sender {
//self.downloadStatus = MPIconDownloadStatusProgress;
KPKNode *node = self.representedObject;
if(!node.asEntry) {
return;