mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
Attachments on Kdb1 Entries are now supported. Saving not implemented. Attach/detach works.
This commit is contained in:
@@ -14,16 +14,16 @@
|
||||
return (self.binary != nil ? 1 : 0);
|
||||
}
|
||||
- (id)objectInBinariesAtIndex:(NSUInteger)index {
|
||||
if(self.binary) {
|
||||
return @"Dummy";
|
||||
}
|
||||
return nil;
|
||||
return self.binary;
|
||||
}
|
||||
- (void)removeObjectFromBinariesAtIndex:(NSUInteger)index {
|
||||
return; // Stubb
|
||||
if(self.binary ) {
|
||||
self.binary = nil;
|
||||
self.binaryDesc = nil;
|
||||
}
|
||||
}
|
||||
- (void)insertObject:(id)binary inBinariesAtIndex:(NSUInteger)index {
|
||||
return; //Stubb
|
||||
return;//
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
if(hasKey) {
|
||||
keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil];
|
||||
}
|
||||
BOOL hasPassword = ![password isEmpty];
|
||||
BOOL hasPassword = ![NSString isEmptyString:password];
|
||||
BOOL passwordOk = YES;
|
||||
if(hasPassword ) {
|
||||
passwordOk = [password isEqualToString:repeat] || self.showPassword;
|
||||
|
||||
@@ -105,6 +105,14 @@
|
||||
[self.treeV4.binaries removeObject:binary];
|
||||
}
|
||||
|
||||
- (void)removeAttachmentFromEntry:(KdbEntry *)anEntry {
|
||||
if(self.version != MPDatabaseVersion3) {
|
||||
return;
|
||||
}
|
||||
Kdb3Entry *entry = (Kdb3Entry *)anEntry;
|
||||
[entry removeObjectFromBinariesAtIndex:0];
|
||||
}
|
||||
|
||||
- (Binary *)findBinary:(BinaryRef *)reference {
|
||||
if(self.version != MPDatabaseVersion4) {
|
||||
return nil;
|
||||
|
||||
@@ -99,6 +99,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
- (void)saveAttachmentFromEntry:(KdbEntry *)anEntry toLocation:(NSURL *)location;
|
||||
- (void)saveAttachment:(BinaryRef *)reference toLocation:(NSURL *)location;
|
||||
- (void)removeAttachment:(BinaryRef *)reference fromEntry:(KdbEntry *)anEntry;
|
||||
- (void)removeAttachmentFromEntry:(KdbEntry *)anEntry;
|
||||
- (NSUInteger)nextBinaryId;
|
||||
- (Binary *)findBinary:(BinaryRef *)reference;
|
||||
|
||||
|
||||
@@ -384,9 +384,9 @@ enum {
|
||||
- (IBAction)removeAttachment:(id)sender {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
if(document.version == MPDatabaseVersion3) {
|
||||
// Handle entry
|
||||
[document removeAttachmentFromEntry:self.selectedEntry];
|
||||
}
|
||||
if(document.version == MPDatabaseVersion4) {
|
||||
else if(document.version == MPDatabaseVersion4) {
|
||||
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
|
||||
BinaryRef *reference = entry.binaries[[sender tag]];
|
||||
[document removeAttachment:reference fromEntry:self.selectedEntry];
|
||||
|
||||
Submodule MiniKeePassLib updated: f23dd68cb4...8f034d6524
Reference in New Issue
Block a user