From ab09149178e7ac0de35941141d07c29314e8b2c3 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 27 Sep 2017 18:06:10 +0200 Subject: [PATCH] using private API of KeePassKit for better performance --- MacPass/MPEntryViewController.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index f2383dcc..5cae43bf 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -112,8 +112,8 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; _dataSource.viewController = self; _menuDelegate = [[MPEntryContextMenuDelegate alloc] init]; _contextBarViewController = [[MPContextBarViewController alloc] init]; - NSString *entriesKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(entries))]; - [_entryArrayController bind:NSContentBinding toObject:self withKeyPath:entriesKeyPath options:nil]; + NSString *entriesKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(mutableEntries))]; + [_entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:entriesKeyPath options:@{NSNullPlaceholderBindingOption: @[]}]; } return self; } @@ -472,7 +472,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; NSArray *result = notification.userInfo[kMPDocumentSearchResultsKey]; NSAssert(result != nil, @"Resutls should never be nil"); self.filteredEntries = result; - [self.entryArrayController bind:NSContentArrayBinding toObject:self withKeyPath:NSStringFromSelector(@selector(filteredEntries)) options:nil]; + self.entryArrayController.content = self.filteredEntries; [self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = NO; [self _updateContextBar]; } @@ -480,7 +480,6 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; - (void)_didExitSearch:(NSNotification *)notification { [self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier].hidden = YES; - [self.entryArrayController unbind:NSContentArrayBinding]; self.entryArrayController.content = nil; self.filteredEntries = nil; self.displayMode = MPDisplayModeEntries;