mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 19:59:29 +00:00
Retain custom file extension if present and do not change back to .kdbx (or .kdb)
This commit is contained in:
@@ -173,6 +173,18 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSString *)fileNameExtensionForType:(NSString *)typeName saveOperation:(NSSaveOperationType)saveOperation {
|
||||
NSString *proposedExtension = [super fileNameExtensionForType:typeName saveOperation:saveOperation];
|
||||
if(!self.fileURL) {
|
||||
return proposedExtension;
|
||||
}
|
||||
NSString *actualExtension = self.fileURL.pathExtension;
|
||||
if(![actualExtension isEqualToString:proposedExtension]) {
|
||||
NSLog(@"Extension missmatch.");
|
||||
}
|
||||
return actualExtension;
|
||||
}
|
||||
|
||||
- (NSData *)dataOfType:(NSString *)typeName error:(NSError * _Nullable __autoreleasing *)outError {
|
||||
if(self.encrypted) {
|
||||
NSLog(@"%@ should not be called on locked databases!", NSStringFromSelector(_cmd));
|
||||
|
||||
Reference in New Issue
Block a user