aboutsummaryrefslogtreecommitdiff
path: root/backends/updates
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-09 17:00:09 +0200
committerEugene Sandulenko2016-04-09 17:04:04 +0200
commitc18a12453ed7702e3ced87d5f42acf7d10b6b41d (patch)
treee32399591540190048046e88fd44de296a0fee68 /backends/updates
parent185b8534086896b8447ae0d280b9e2dde67a6f5d (diff)
downloadscummvm-rg350-c18a12453ed7702e3ced87d5f42acf7d10b6b41d.tar.gz
scummvm-rg350-c18a12453ed7702e3ced87d5f42acf7d10b6b41d.tar.bz2
scummvm-rg350-c18a12453ed7702e3ced87d5f42acf7d10b6b41d.zip
UPDATES: Implemented method getLastUpdateCheckTimeAndDate()
Currently it uses methods and constants deprecated in 10.10. 10.10+ -specific code will follow
Diffstat (limited to 'backends/updates')
-rw-r--r--backends/updates/macosx/macosx-updates.h2
-rw-r--r--backends/updates/macosx/macosx-updates.mm17
2 files changed, 19 insertions, 0 deletions
diff --git a/backends/updates/macosx/macosx-updates.h b/backends/updates/macosx/macosx-updates.h
index 9f541ad02a..6fb9af7712 100644
--- a/backends/updates/macosx/macosx-updates.h
+++ b/backends/updates/macosx/macosx-updates.h
@@ -41,6 +41,8 @@ public:
virtual void setUpdateCheckInterval(int interval);
virtual int getUpdateCheckInterval();
+
+ virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t);
};
#endif
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