mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
UPDATES: Implemented method getLastUpdateCheckTimeAndDate()
Currently it uses methods and constants deprecated in 10.10. 10.10+ -specific code will follow
This commit is contained in:
parent
185b853408
commit
c18a12453e
@ -41,6 +41,8 @@ public:
|
||||
|
||||
virtual void setUpdateCheckInterval(int interval);
|
||||
virtual int getUpdateCheckInterval();
|
||||
|
||||
virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -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
|
||||
|
@ -94,6 +94,14 @@ public:
|
||||
*/
|
||||
virtual int getUpdateCheckInterval() { return kUpdateIntervalNotSupported; }
|
||||
|
||||
/**
|
||||
* Gets last update check time
|
||||
*
|
||||
* @param t TimeDate struct to fill out
|
||||
* @return flag indicating success
|
||||
*/
|
||||
virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t) { return false; }
|
||||
|
||||
/**
|
||||
* Returns list of supported uptate intervals.
|
||||
* Ending with '-1' which is not acceptable value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user