From 8cf84293b5660cd0d61b2222dd68b0b24364d5fd Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 31 Aug 2008 20:05:46 +0000 Subject: [PATCH] some cleanup of the blocklist code, and store the date of the last blocklist update --- macosx/BlocklistDownloader.m | 4 ++-- macosx/BlocklistDownloaderViewController.m | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/macosx/BlocklistDownloader.m b/macosx/BlocklistDownloader.m index 08e1b5012..0d08904cd 100644 --- a/macosx/BlocklistDownloader.m +++ b/macosx/BlocklistDownloader.m @@ -91,7 +91,6 @@ BlocklistDownloader * fDownloader = nil; [fViewController setStatusProgressForCurrentSize: fCurrentSize expectedSize: fExpectedSize]; } -#warning release? - (void) download: (NSURLDownload *) download didFailWithError: (NSError *) error { [fViewController setFailed: [error localizedDescription]]; @@ -147,7 +146,8 @@ BlocklistDownloader * fDownloader = nil; [fViewController setFinished]; - #warning update date + [[NSUserDefaults standardUserDefaults] setObject: [NSDate date] forKey: @"BlocklistLastUpdate"]; + [[NSNotificationCenter defaultCenter] postNotificationName: @"BlocklistUpdated" object: nil]; [pool release]; diff --git a/macosx/BlocklistDownloaderViewController.m b/macosx/BlocklistDownloaderViewController.m index 3831e6831..e0d44f721 100644 --- a/macosx/BlocklistDownloaderViewController.m +++ b/macosx/BlocklistDownloaderViewController.m @@ -26,7 +26,6 @@ #import "BlocklistDownloader.h" #import "PrefsController.h" #import "NSStringAdditions.h" -#import "NSApplicationAdditions.h" @interface BlocklistDownloaderViewController (Private) @@ -82,7 +81,7 @@ [fProgressBar setDoubleValue: (double)currentSize / expectedSize]; } else - string = [string stringByAppendingFormat: @" (%@)", [NSString stringForFileSize: expectedSize]]; + string = [string stringByAppendingFormat: @" (%@)", [NSString stringForFileSize: currentSize]]; [fTextField setStringValue: string]; } @@ -108,9 +107,6 @@ - (void) setFailed: (NSString *) error { - #warning remove? - //[fProgressBar setHidden: YES]; - [NSApp endSheet: fStatusWindow]; [fStatusWindow orderOut: self];