mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Bugfix: don't remove all notifications from the web history controller
removeObserver: removes the controller from all notifications. The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences.
This commit is contained in:
@@ -67,13 +67,15 @@
|
||||
NSFileHandle *handle = [repository handleForArguments:taskArguments];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
// Remove notification, in case we have another one running
|
||||
[nc removeObserver:self];
|
||||
[nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil];
|
||||
[nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
|
||||
[handle readToEndOfFileInBackgroundAndNotify];
|
||||
}
|
||||
|
||||
- (void)commitDetailsLoaded:(NSNotification *)notification
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil];
|
||||
|
||||
NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem];
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user