From 1d3e5753d3a16809c5ac1d2eb14fba25f8099538 Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 16 Aug 2016 19:43:56 -0400 Subject: [PATCH] -automaticallyDownloadsUpdates should take account if developer disables automatic updates This behavior is more consistent with the official branch. --- Sparkle/SPUUpdater.h | 2 +- Sparkle/SPUUpdater.m | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Sparkle/SPUUpdater.h b/Sparkle/SPUUpdater.h index 371b35ad..626a8ed7 100644 --- a/Sparkle/SPUUpdater.h +++ b/Sparkle/SPUUpdater.h @@ -88,7 +88,7 @@ SU_EXPORT @interface SPUUpdater : NSObject /*! * A property indicating whether or not updates can be automatically downloaded in the background. * - * Note that the developer can disallow automatic downloading of updates. + * Note that the developer can disallow automatic downloading of updates from being enabled. */ @property (nonatomic) BOOL automaticallyDownloadsUpdates; diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index 67225262..31bde8cc 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -420,7 +420,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification } id updateDriver; - if (!installerIsRunning && [strongSelf automaticallyDownloadsUpdates] && [strongSelf allowsAutomaticUpdates] && strongSelf.resumableUpdate == nil) { + if (!installerIsRunning && [strongSelf automaticallyDownloadsUpdates] && strongSelf.resumableUpdate == nil) { updateDriver = [[SUAutomaticUpdateDriver alloc] initWithHost:strongSelf.host @@ -614,12 +614,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification - (BOOL)automaticallyDownloadsUpdates { - return [self.updaterSettings automaticallyDownloadsUpdates]; -} - -- (BOOL)allowsAutomaticUpdates -{ - return [self.updaterSettings allowsAutomaticUpdates]; + return [self.updaterSettings allowsAutomaticUpdates] && [self.updaterSettings automaticallyDownloadsUpdates]; } - (void)setFeedURL:(NSURL *)feedURL