Fixed #657 exiting history display does not break entry display

This commit is contained in:
michael starke
2017-10-09 19:34:41 +02:00
parent d9b9cd78cb
commit 21ea2a5bc9
3 changed files with 9 additions and 5 deletions

View File

@@ -1,3 +1,3 @@
github "sparkle-project/Sparkle" ~> 1.18.1
github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486"
github "mstarke/KeePassKit" "6cf17cc6f730c72b02d69ef4becdaceabbc15bd7"
github "mstarke/HNHUi" ~> 1.1

View File

@@ -1,3 +1,3 @@
github "mstarke/HNHUi" "1.2"
github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486"
github "mstarke/KeePassKit" "6cf17cc6f730c72b02d69ef4becdaceabbc15bd7"
github "sparkle-project/Sparkle" "1.18.1"

View File

@@ -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;