Skip to content

Commit e093561

Browse files
committed
Remove indirect dispatch for Find… menu item
1 parent 889c350 commit e093561

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

Classes/Controllers/PBGitHistoryController.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ - (void)loadView {
168168
// listen for updates
169169
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_repositoryUpdatedNotification:) name:PBGitRepositoryEventNotification object:repository];
170170

171-
__weak typeof(self) weakSelf = self;
172-
commitList.findPanelActionBlock = ^(id sender) {
173-
__strong typeof(weakSelf) strongSelf = weakSelf;
174-
[weakSelf.view.window makeFirstResponder:strongSelf->searchField];
175-
};
176-
177171
[super awakeFromNib];
178172
}
179173

@@ -427,6 +421,11 @@ - (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode
427421
[searchController setHistorySearch:searchString mode:mode];
428422
}
429423

424+
- (IBAction)performFindPanelAction:(id)sender
425+
{
426+
[self.windowController.window makeFirstResponder:self->searchField];
427+
}
428+
430429
// NSSearchField (actually textfields in general) prevent the normal Find operations from working. Setup custom actions for the
431430
// next and previous menuitems (in MainMenu.nib) so they will work when the search field is active. When searching for text in
432431
// a file make sure to call the Find panel's action method instead.

Classes/PBCommitList.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
@class PBWebHistoryController;
1515
@class PBHistorySearchController;
1616

17-
typedef void(^PBFindPanelActionBlock)(id sender);
18-
1917
@interface PBCommitList : NSTableView {
2018
__weak IBOutlet WebView* webView;
2119
__weak IBOutlet PBWebHistoryController *webController;
@@ -29,6 +27,5 @@ typedef void(^PBFindPanelActionBlock)(id sender);
2927

3028
@property (readonly) NSPoint mouseDownPoint;
3129
@property (assign) BOOL useAdjustScroll;
32-
@property (copy) PBFindPanelActionBlock findPanelActionBlock;
3330

3431
@end

Classes/PBCommitList.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,4 @@ - (NSMenu *)menuForEvent:(NSEvent *)event
154154
return menu;
155155
}
156156

157-
158-
#pragma mark Row highlighting
159-
160-
- (IBAction)performFindPanelAction:(id)sender
161-
{
162-
PBFindPanelActionBlock block = self.findPanelActionBlock;
163-
if (block) {
164-
block(sender);
165-
}
166-
}
167-
168157
@end

0 commit comments

Comments
 (0)