From 223a368cce5a72022dbd0c14696aa747dd7342d4 Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 8 Mar 2016 19:15:28 +0100 Subject: [PATCH] Fixed broken display of custom icons --- Cartfile | 2 +- Cartfile.resolved | 2 +- MacPass/KPKNode+IconImage.m | 8 ++------ MacPass/MPEntryProxy.m | 2 ++ MacPassTests/MPTextEntryProxy.m | 6 +++++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Cartfile b/Cartfile index 686ed805..bf46ae0c 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ github "sparkle-project/Sparkle" ~> 1.13.1 -github "mstarke/KeePassKit" "d8710185ff3c4f21c12f4c10eb68d570179c54ee" +github "mstarke/KeePassKit" "4406caed2050c0b5be911d66589647c205660f32" github "mstarke/HNHUi" ~> 1.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 9dc39a1a..183858cc 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ github "mstarke/HNHUi" "1.0.1" -github "mstarke/KeePassKit" "d8710185ff3c4f21c12f4c10eb68d570179c54ee" +github "mstarke/KeePassKit" "4406caed2050c0b5be911d66589647c205660f32" github "sparkle-project/Sparkle" "1.13.1" diff --git a/MacPass/KPKNode+IconImage.m b/MacPass/KPKNode+IconImage.m index f6f8da66..0ca8762d 100644 --- a/MacPass/KPKNode+IconImage.m +++ b/MacPass/KPKNode+IconImage.m @@ -32,12 +32,8 @@ const BOOL isGroup = [self isKindOfClass:[KPKGroup class]]; return [MPIconHelper icon:(isGroup ? MPIconExpiredGroup : MPIconExpiredEntry)]; } - - if(self.iconUUID) { - KPKIcon *icon;// = [self.tree.metaData findIcon:self.iconUUID]; - if(icon && icon.image) { - return icon.image; - } + if(self.icon) { + return self.icon.image; } return [MPIconHelper icon:(MPIconType)self.iconId]; } diff --git a/MacPass/MPEntryProxy.m b/MacPass/MPEntryProxy.m index bfcb40ce..181dab60 100644 --- a/MacPass/MPEntryProxy.m +++ b/MacPass/MPEntryProxy.m @@ -26,10 +26,12 @@ } - (void)forwardInvocation:(NSInvocation *)invocation { + NSLog(@"forwardInvocation: %@", NSStringFromSelector(invocation.selector)); [invocation invokeWithTarget:self.entry]; } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { + NSLog(@"methodSignatureForSelector %@", NSStringFromSelector(sel)); return [self.entry methodSignatureForSelector:sel]; } diff --git a/MacPassTests/MPTextEntryProxy.m b/MacPassTests/MPTextEntryProxy.m index 1b711baa..fa31ed8d 100644 --- a/MacPassTests/MPTextEntryProxy.m +++ b/MacPassTests/MPTextEntryProxy.m @@ -39,8 +39,12 @@ - (void)testMethodForwarding { NSString *newPassword = @"new password"; + NSString *newKeystrokes = @"{ENTER 3}"; [((id)self.proxy) setPassword:newPassword]; - XCTAssertEqualObjects(self.entry.password, newPassword, @"Proxy has forwared password setting to KPKEntry!"); + XCTAssertEqualObjects(self.entry.password, newPassword, @"Proxy sets password on entry!"); + + [((id)self.proxy) autotype].defaultKeystrokeSequence= newKeystrokes; + XCTAssertEqualObjects(self.entry.autotype.defaultKeystrokeSequence, newKeystrokes, @"Proxy sets default keystroke sequence on entry autotype!"); } @end