mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
only save database on lock if file was acutally changed. Otherweise leave it be.
This commit is contained in:
2
Cartfile
2
Cartfile
@@ -1,3 +1,3 @@
|
|||||||
github "sparkle-project/Sparkle" ~> 1.18.1
|
github "sparkle-project/Sparkle" ~> 1.18.1
|
||||||
github "MacPass/KeePassKit" ~> 1.8
|
github "MacPass/KeePassKit" ~> 1.9
|
||||||
github "mstarke/HNHUi" ~> 1.4.1
|
github "mstarke/HNHUi" ~> 1.4.1
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
github "MacPass/KeePassKit" "1.8"
|
github "MacPass/KeePassKit" "1.9"
|
||||||
github "mstarke/HNHUi" "1.4.1"
|
github "mstarke/HNHUi" "1.4.1"
|
||||||
github "sparkle-project/Sparkle" "1.18.1"
|
github "sparkle-project/Sparkle" "1.18.1"
|
||||||
|
|||||||
@@ -417,7 +417,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
for(NSWindow *sheet in [self windowForSheet].sheets) {
|
for(NSWindow *sheet in [self windowForSheet].sheets) {
|
||||||
[[self windowForSheet] endSheet:sheet];
|
[[self windowForSheet] endSheet:sheet];
|
||||||
}
|
}
|
||||||
[self saveDocumentWithDelegate:self didSaveSelector:@selector(_lockDatabaseForDocument:didSave:contextInfo:) contextInfo:NULL];
|
if(self.documentEdited) {
|
||||||
|
[self saveDocumentWithDelegate:self didSaveSelector:@selector(_lockDatabaseForDocument:didSave:contextInfo:) contextInfo:NULL];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[self _lockDatabaseForDocument:self didSave:YES contextInfo:NULL];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,8 +438,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
[self exitSearch:self];
|
[self exitSearch:self];
|
||||||
[self.undoManager removeAllActions];
|
[self.undoManager removeAllActions];
|
||||||
NSError *error;
|
NSError *error;
|
||||||
/* TODO let the tree chose the encryption */
|
/* use data from disk since we wrote it*/
|
||||||
self.encryptedData = [self.tree encryptWithKey:self.compositeKey format:[MPDocument formatForFileType:self.fileType] error:&error];
|
self.encryptedData = [NSData dataWithContentsOfURL:self.fileURL options:NSDataReadingUncached error:&error];
|
||||||
if(nil == self.encryptedData && error ) {
|
if(nil == self.encryptedData && error ) {
|
||||||
[self presentError:error];
|
[self presentError:error];
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user