From 6f3d1248682669ccf9c2a8554d23e904f17df7f0 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Fri, 30 May 2008 21:34:23 -0700 Subject: [PATCH] Fixing bug 228469: Now if the developer sets a value for SUEnableAutomaticChecks in Info.plist, we assume that's a good default value to take, and we don't ask the user what he wants to do on startup. If he doesn't specify any preference of his own, we take the Info.plist value to be the canonical one. --- SUUpdater.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SUUpdater.m b/SUUpdater.m index f93fcd2f..fdf7da7c 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -53,8 +53,9 @@ static SUUpdater *sharedUpdater = nil; if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] && [[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == NO) { return; } - // Has he been asked already? - if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil) + // Has he been asked already? And don't ask if the host has a default value set in its Info.plist. + if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil && + [hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] == nil) { if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKeyOld]) [[SUUserDefaults standardUserDefaults] setBool:[[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKeyOld] forKey:SUEnableAutomaticChecksKey]; @@ -66,7 +67,10 @@ static SUUpdater *sharedUpdater = nil; [SUUpdatePermissionPrompt promptWithHostBundle:hostBundle delegate:self]; } - if ([[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == YES) + // We check if the user's said they want updates, or they haven't said anything, and the default is set to checking. + if ([[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == YES || + ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil && + [[hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] boolValue] == YES)) [self beginUpdateCycle]; }