aboutsummaryrefslogtreecommitdiff
path: root/backends/updates/macosx/macosx-updates.mm
diff options
context:
space:
mode:
Diffstat (limited to 'backends/updates/macosx/macosx-updates.mm')
-rw-r--r--backends/updates/macosx/macosx-updates.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/backends/updates/macosx/macosx-updates.mm b/backends/updates/macosx/macosx-updates.mm
index fc967f8fec..273d80acc5 100644
--- a/backends/updates/macosx/macosx-updates.mm
+++ b/backends/updates/macosx/macosx-updates.mm
@@ -23,6 +23,7 @@
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/system.h"
#include "backends/updates/macosx/macosx-updates.h"
#ifdef USE_SPARKLE
@@ -133,4 +134,20 @@ int MacOSXUpdateManager::getUpdateCheckInterval() {
}
}
+bool MacOSXUpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) {
+ NSDate *date = [sparkleUpdater lastUpdateCheckDate];
+ NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
+ NSDateComponents *components = [gregorian components:(NSDayCalendarUnit | NSWeekdayCalendarUnit) fromDate:date];
+
+ t.tm_wday = [components weekday];
+ t.tm_year = [components year];
+ t.tm_mon = [components month];
+ t.tm_mday = [components day];
+ t.tm_hour = [components hour];
+ t.tm_min = [components minute];
+ t.tm_sec = [components second];
+
+ return true;
+}
+
#endif