File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 9
9
#import " PBWebChangesController.h"
10
10
#import " PBGitIndex.h"
11
11
12
+ static void * const UnstagedFileSelectedContext = @" UnstagedFileSelectedContext" ;
13
+ static void * const CachedFileSelectedContext = @" CachedFileSelectedContext" ;
14
+
12
15
@interface PBWebChangesController () <WebEditingDelegate , WebUIDelegate >
13
16
@end
14
17
@@ -22,8 +25,8 @@ - (void) awakeFromNib
22
25
startFile = @" commit" ;
23
26
[super awakeFromNib ];
24
27
25
- [unstagedFilesController addObserver: self forKeyPath: @" selection" options: 0 context: @" UnstagedFileSelected " ];
26
- [stagedFilesController addObserver: self forKeyPath: @" selection" options: 0 context: @" cachedFileSelected " ];
28
+ [unstagedFilesController addObserver: self forKeyPath: @" selection" options: 0 context: UnstagedFileSelectedContext ];
29
+ [stagedFilesController addObserver: self forKeyPath: @" selection" options: 0 context: CachedFileSelectedContext ];
27
30
28
31
self.view .editingDelegate = self;
29
32
self.view .UIDelegate = self;
@@ -49,6 +52,10 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
49
52
change : (NSDictionary *)change
50
53
context : (void *)context
51
54
{
55
+ if (context != UnstagedFileSelectedContext && context != CachedFileSelectedContext) {
56
+ return [super observeValueForKeyPath: keyPath ofObject: object change: change context: context];
57
+ }
58
+
52
59
NSArrayController *otherController;
53
60
otherController = object == unstagedFilesController ? stagedFilesController : unstagedFilesController;
54
61
NSUInteger count = [object selectedObjects ].count ;
You can’t perform that action at this time.
0 commit comments