From 693a23d545b758cd3cc60b714ffbed08c55c075a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Jun 2010 12:07:41 -0600 Subject: [PATCH] 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. --- PBWebHistoryController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index e3467c0..08279cf 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -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;