mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +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);
|
return (self.binary != nil ? 1 : 0);
|
||||||
}
|
}
|
||||||
- (id)objectInBinariesAtIndex:(NSUInteger)index {
|
- (id)objectInBinariesAtIndex:(NSUInteger)index {
|
||||||
if(self.binary) {
|
return self.binary;
|
||||||
return @"Dummy";
|
|
||||||
}
|
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
- (void)removeObjectFromBinariesAtIndex:(NSUInteger)index {
|
- (void)removeObjectFromBinariesAtIndex:(NSUInteger)index {
|
||||||
return; // Stubb
|
if(self.binary ) {
|
||||||
|
self.binary = nil;
|
||||||
|
self.binaryDesc = nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
- (void)insertObject:(id)binary inBinariesAtIndex:(NSUInteger)index {
|
- (void)insertObject:(id)binary inBinariesAtIndex:(NSUInteger)index {
|
||||||
return; //Stubb
|
return;//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
if(hasKey) {
|
if(hasKey) {
|
||||||
keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil];
|
keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil];
|
||||||
}
|
}
|
||||||
BOOL hasPassword = ![password isEmpty];
|
BOOL hasPassword = ![NSString isEmptyString:password];
|
||||||
BOOL passwordOk = YES;
|
BOOL passwordOk = YES;
|
||||||
if(hasPassword ) {
|
if(hasPassword ) {
|
||||||
passwordOk = [password isEqualToString:repeat] || self.showPassword;
|
passwordOk = [password isEqualToString:repeat] || self.showPassword;
|
||||||
|
|||||||
@@ -105,6 +105,14 @@
|
|||||||
[self.treeV4.binaries removeObject:binary];
|
[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 {
|
- (Binary *)findBinary:(BinaryRef *)reference {
|
||||||
if(self.version != MPDatabaseVersion4) {
|
if(self.version != MPDatabaseVersion4) {
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
|||||||
- (void)saveAttachmentFromEntry:(KdbEntry *)anEntry toLocation:(NSURL *)location;
|
- (void)saveAttachmentFromEntry:(KdbEntry *)anEntry toLocation:(NSURL *)location;
|
||||||
- (void)saveAttachment:(BinaryRef *)reference toLocation:(NSURL *)location;
|
- (void)saveAttachment:(BinaryRef *)reference toLocation:(NSURL *)location;
|
||||||
- (void)removeAttachment:(BinaryRef *)reference fromEntry:(KdbEntry *)anEntry;
|
- (void)removeAttachment:(BinaryRef *)reference fromEntry:(KdbEntry *)anEntry;
|
||||||
|
- (void)removeAttachmentFromEntry:(KdbEntry *)anEntry;
|
||||||
- (NSUInteger)nextBinaryId;
|
- (NSUInteger)nextBinaryId;
|
||||||
- (Binary *)findBinary:(BinaryRef *)reference;
|
- (Binary *)findBinary:(BinaryRef *)reference;
|
||||||
|
|
||||||
|
|||||||
@@ -384,9 +384,9 @@ enum {
|
|||||||
- (IBAction)removeAttachment:(id)sender {
|
- (IBAction)removeAttachment:(id)sender {
|
||||||
MPDocument *document = [[self windowController] document];
|
MPDocument *document = [[self windowController] document];
|
||||||
if(document.version == MPDatabaseVersion3) {
|
if(document.version == MPDatabaseVersion3) {
|
||||||
// Handle entry
|
[document removeAttachmentFromEntry:self.selectedEntry];
|
||||||
}
|
}
|
||||||
if(document.version == MPDatabaseVersion4) {
|
else if(document.version == MPDatabaseVersion4) {
|
||||||
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
|
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
|
||||||
BinaryRef *reference = entry.binaries[[sender tag]];
|
BinaryRef *reference = entry.binaries[[sender tag]];
|
||||||
[document removeAttachment:reference fromEntry:self.selectedEntry];
|
[document removeAttachment:reference fromEntry:self.selectedEntry];
|
||||||
|
|||||||
Submodule MiniKeePassLib updated: f23dd68cb4...8f034d6524
Reference in New Issue
Block a user