Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Provide getter for SULastCheckTimeKey

  • Loading branch information...
commit c71bf3ccbee23215b9da2a6d443539c488549e19 1 parent 724b4de
Peter Speck authored
Showing with 11 additions and 2 deletions.
  1. +4 −1 SUUpdater.h
  2. +7 −1 SUUpdater.m
View
5 SUUpdater.h
@@ -51,11 +51,14 @@
// update is found, it will be downloaded and prepped for installation.
- (void)checkForUpdatesInBackground;
+// Date of last update check. Returns null if no check has been performed.
+- (NSDate*)lastUpdateCheckDate;
+
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
- (void)checkForUpdateInformation;
-// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks.
+// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer.
- (void)resetUpdateCycle;
- (BOOL)updateInProgress;
View
8 SUUpdater.m
@@ -136,6 +136,12 @@ - (void)updateDriverDidFinish:(NSNotification *)note
}
}
+- (NSDate*)lastUpdateCheckDate
+{
+ return [host objectForUserDefaultsKey:SULastCheckTimeKey];
+}
+
+
- (void)scheduleNextUpdateCheck
{
if (checkTimer)
@@ -146,7 +152,7 @@ - (void)scheduleNextUpdateCheck
if (![self automaticallyChecksForUpdates]) return;
// How long has it been since last we checked for an update?
- NSDate *lastCheckDate = [host objectForUserDefaultsKey:SULastCheckTimeKey];
+ NSDate *lastCheckDate = [self lastUpdateCheckDate];
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
NSTimeInterval intervalSinceCheck = [[NSDate date] timeIntervalSinceDate:lastCheckDate];
Please sign in to comment.
Something went wrong with that request. Please try again.