From 6ade2f270b830cc7e766c02e557b2d4f41a13e8b Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 28 Feb 2016 21:01:49 -0500 Subject: [PATCH] Don't see why this method should be very generic --- Sparkle/SUUpdater.h | 2 +- Sparkle/SUUpdater.m | 4 ++-- Sparkle/SUUpdaterController.m | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index 6097a8dc..fc01d6d4 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -112,7 +112,7 @@ SU_EXPORT @interface SUUpdater : NSObject */ - (void)resetUpdateCycle; -- (void)resetUpdateCycleAfterDelay:(NSTimeInterval)delay; +- (void)resetUpdateCycleAfterShortDelay; @property (readonly) BOOL updateInProgress; diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 5b037011..f7dd9290 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -352,10 +352,10 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, SU [self scheduleNextUpdateCheck]; } -- (void)resetUpdateCycleAfterDelay:(NSTimeInterval)delay +- (void)resetUpdateCycleAfterShortDelay { [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil]; - [self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:delay]; + [self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:1]; } - (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyCheckForUpdates diff --git a/Sparkle/SUUpdaterController.m b/Sparkle/SUUpdaterController.m index 2a559b19..6d2bc2c0 100644 --- a/Sparkle/SUUpdaterController.m +++ b/Sparkle/SUUpdaterController.m @@ -87,7 +87,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (context == (__bridge void *)(SUUpdaterDefaultsObservationContext)) { // Allow a small delay, because perhaps the user or developer wants to change both preferences. This allows the developer to interpret a zero check interval as a sign to disable automatic checking. // Or we may get this from the developer and from our own KVO observation, this will effectively coalesce them. - [self.updater resetUpdateCycleAfterDelay:1]; + [self.updater resetUpdateCycleAfterShortDelay]; } else { if ([super respondsToSelector:@selector(observeValueForKeyPath:ofObject:change:context:)]) { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];