From 21ea2a5bc90f0789a904c6b6af1acea144f8be06 Mon Sep 17 00:00:00 2001 From: michael starke Date: Mon, 9 Oct 2017 19:34:41 +0200 Subject: [PATCH] Fixed #657 exiting history display does not break entry display --- Cartfile | 2 +- Cartfile.resolved | 2 +- MacPass/MPEntryViewController.m | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cartfile b/Cartfile index ef21b9ff..fe69e79d 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ github "sparkle-project/Sparkle" ~> 1.18.1 -github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486" +github "mstarke/KeePassKit" "6cf17cc6f730c72b02d69ef4becdaceabbc15bd7" github "mstarke/HNHUi" ~> 1.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 3beb4df6..0d25c2fa 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ github "mstarke/HNHUi" "1.2" -github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486" +github "mstarke/KeePassKit" "6cf17cc6f730c72b02d69ef4becdaceabbc15bd7" github "sparkle-project/Sparkle" "1.18.1" diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 05e008ea..cdabb73f 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -112,8 +112,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; _dataSource.viewController = self; _menuDelegate = [[MPEntryContextMenuDelegate alloc] init]; _contextBarViewController = [[MPContextBarViewController alloc] init]; - NSString *entriesKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), KPKEntriesArrayBinding]; - [_entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:entriesKeyPath options:@{NSNullPlaceholderBindingOption: @[]}]; + [self _setupEntryBindings]; } return self; } @@ -517,7 +516,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; - (void)_hideEntryHistory:(NSNotification *)notification { self.displayMode = MPDisplayModeEntries; - [self.entryArrayController unbind:NSContentArrayBinding]; + [self _setupEntryBindings]; self.entryArrayController.content = nil; [self _updateContextBar]; MPDocument *document = notification.object; @@ -542,6 +541,11 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; } } +- (void)_setupEntryBindings { + NSString *entriesKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), KPKEntriesArrayBinding]; + [self.entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:entriesKeyPath options:@{NSNullPlaceholderBindingOption: @[]}]; +} + - (void)_showContextBar { if(_isDisplayingContextBar) { return;