From 435f89c11ffbdcfe77fc1d2b0e2dee06d6d27289 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sat, 28 Jun 2014 21:02:33 -0400 Subject: [PATCH] Replace id with specific types where appropriate. --- SUPipedUnarchiver.m | 11 +++++++---- SUUpdatePermissionPrompt.m | 4 ++-- SUUpdater.m | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m index 37699f6d..ba7436a1 100644 --- a/SUPipedUnarchiver.m +++ b/SUPipedUnarchiver.m @@ -17,12 +17,15 @@ { static NSDictionary *typeSelectorDictionary; if (!typeSelectorDictionary) - typeSelectorDictionary = [@{@".zip": @"extractZIP", @".tar": @"extractTAR", - @".tar.gz": @"extractTGZ", @".tgz": @"extractTGZ", - @".tar.bz2": @"extractTBZ", @".tbz": @"extractTBZ"} retain]; + typeSelectorDictionary = [@{@".zip": @"extractZIP", + @".tar": @"extractTAR", + @".tar.gz": @"extractTGZ", + @".tgz": @"extractTGZ", + @".tar.bz2": @"extractTBZ", + @".tbz": @"extractTBZ"} retain]; NSString *lastPathComponent = [path lastPathComponent]; - for (id currentType in typeSelectorDictionary) + for (NSString *currentType in typeSelectorDictionary) { if ([currentType length] > [lastPathComponent length]) continue; if ([[lastPathComponent substringFromIndex:[lastPathComponent length] - [currentType length]] isEqualToString:currentType]) diff --git a/SUUpdatePermissionPrompt.m b/SUUpdatePermissionPrompt.m index d8e4656e..140334ab 100644 --- a/SUUpdatePermissionPrompt.m +++ b/SUUpdatePermissionPrompt.m @@ -42,9 +42,9 @@ // If this is a background application we need to focus it in order to bring the prompt // to the user's attention. Otherwise the prompt would be hidden behind other applications and // the user would not know why the application was paused. - if ([aHost isBackgroundApplication]) { [NSApp activateIgnoringOtherApps:YES]; } + if ([aHost isBackgroundApplication]) { [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } - id prompt = [[[[self class] alloc] initWithHost:aHost systemProfile:profile delegate:d] autorelease]; + SUUpdatePermissionPrompt *prompt = [[[[self class] alloc] initWithHost:aHost systemProfile:profile delegate:d] autorelease]; [NSApp runModalForWindow:[prompt window]]; } diff --git a/SUUpdater.m b/SUUpdater.m index 9377acd8..744487d9 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -259,7 +259,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault [self putFeedURLIntoDictionary:theDict]; // Get feed URL on main thread, it's not safe to call elsewhere. }); - const char *hostname = [[theDict[@"feedURL"] host] cStringUsingEncoding: NSUTF8StringEncoding]; + const char *hostname = [[(NSURL *)theDict[@"feedURL"] host] cStringUsingEncoding: NSUTF8StringEncoding]; SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname); Boolean reachabilityResult = NO; // If the feed's using a file:// URL, we won't be able to use reachability.