File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,16 @@ - (void)setupSearch {
5353 [NSNotificationCenter .defaultCenter addObserver: self selector: @selector (textDidChange: ) name: NSTextDidChangeNotification object: nil ];
5454}
5555
56+ - (void )resetSearch {
57+ [self .searchTextField setStringValue: @" " ];
58+ [self .repository updateFilePattern: nil ];
59+ }
60+
61+ - (void )unsetSearch {
62+ [NSNotificationCenter .defaultCenter removeObserver: self ];
63+ }
64+
5665- (void )textDidChange : (NSNotification *)notification {
57- NSLog (@" NewValue: %@ " , self.searchTextField .stringValue );
5866 NSString *text = self.searchTextField .stringValue ;
5967 if ([@" " isEqualToString: text]) {
6068 [self .repository updateFilePattern: nil ];
@@ -116,6 +124,15 @@ - (void)viewDidDisappear {
116124 self.repository .statusMode = kGCLiveRepositoryStatusMode_Disabled ;
117125}
118126
127+ - (void )viewWillDisappear {
128+ [super viewWillDisappear ];
129+ [self resetSearch ];
130+ }
131+
132+ - (void )dealloc {
133+ [self unsetSearch ];
134+ }
135+
119136#pragma mark - Repository Handling
120137- (void )repositoryStatusDidUpdate {
121138 [super repositoryStatusDidUpdate ];
You can’t perform that action at this time.
0 commit comments