Skip to content

Commit 68bfe93

Browse files
committed
Make the history controller responsible of the main search method
This allows us to remove the implementation from the sidebar controller
1 parent f8a6ba7 commit 68bfe93

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

Classes/Controllers/PBGitHistoryController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
- (void)showCommitsFromTree:(id)sender;
7979

8080
// Find/Search methods
81+
- (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode;
8182
- (IBAction)selectNext:(id)sender;
8283
- (IBAction)selectPrevious:(id)sender;
8384

Classes/Controllers/PBGitHistoryController.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ - (void)keyDown:(NSEvent*)event
371371
[super keyDown: event];
372372
}
373373

374+
- (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode
375+
{
376+
[searchController setHistorySearch:searchString mode:mode];
377+
}
378+
374379
// NSSearchField (actually textfields in general) prevent the normal Find operations from working. Setup custom actions for the
375380
// next and previous menuitems (in MainMenu.nib) so they will work when the search field is active. When searching for text in
376381
// a file make sure to call the Find panel's action method instead.
@@ -543,7 +548,7 @@ - (NSMenu *)tableColumnMenu
543548
- (void)showCommitsFromTree:(id)sender
544549
{
545550
NSString *searchString = [(NSArray *)[sender representedObject] componentsJoinedByString:@" "];
546-
[searchController setHistorySearch:searchString mode:PBHistorySearchModePath];
551+
[self setHistorySearch:searchString mode:PBHistorySearchModePath];
547552
}
548553

549554
- (void) checkoutFiles:(id)sender

Classes/Controllers/PBGitSidebarController.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040

4141
- (IBAction) fetchPullPushAction:(id)sender;
4242

43-
- (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode;
44-
4543
@property(readonly) NSMutableArray *items;
4644
@property(readonly) PBSourceViewItem *remotes;
4745
@property(readonly) NSOutlineView *sourceView;

Classes/Controllers/PBGitSidebarController.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,6 @@ - (void) removeRevSpec:(PBGitRevSpecifier *)rev
215215
[sourceView reloadData];
216216
}
217217

218-
- (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode
219-
{
220-
[historyViewController.searchController setHistorySearch:searchString mode:mode];
221-
}
222-
223218
- (void) openSubmoduleFromMenuItem:(NSMenuItem *)menuItem
224219
{
225220
[self openSubmoduleAtURL:[menuItem representedObject]];

Classes/Controllers/PBGitWindowController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
230230

231231
- (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode
232232
{
233-
[sidebarController setHistorySearch:searchString mode:mode];
233+
[_historyViewController setHistorySearch:searchString mode:mode];
234234
}
235235

236236

0 commit comments

Comments
 (0)