diff options
author | Johannes Schickel | 2012-06-25 19:59:46 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-06-25 19:59:46 +0200 |
commit | 7b44c20eb114515a1117df7f930ed98af0528db4 (patch) | |
tree | fd5a55939a60623aa4606adb11538418a3cf160e /backends/platform | |
parent | 20a781c02047cc8e2908e77707115db09a9aa59f (diff) | |
download | scummvm-rg350-7b44c20eb114515a1117df7f930ed98af0528db4.tar.gz scummvm-rg350-7b44c20eb114515a1117df7f930ed98af0528db4.tar.bz2 scummvm-rg350-7b44c20eb114515a1117df7f930ed98af0528db4.zip |
BADA: Implement weekday querying in getTimeAndDate.
This furthermore makes the returned time be the wall time instead of UTC.
Thanks to Chris Warren-Smith for testing and improving a patch based
on pull request #248.
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/bada/system.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp index 816a6755fc..3f862c2571 100644 --- a/backends/platform/bada/system.cpp +++ b/backends/platform/bada/system.cpp @@ -21,6 +21,7 @@ */ #include <FUiCtrlMessageBox.h> +#include <FLocales.h> #include "common/config-manager.h" #include "common/file.h" @@ -42,7 +43,9 @@ using namespace Osp::Base; using namespace Osp::Base::Runtime; +using namespace Osp::Locales; using namespace Osp::Ui::Controls; +using namespace Osp::System; #define DEFAULT_CONFIG_FILE "/Home/scummvm.ini" #define RESOURCE_PATH "/Res" @@ -305,7 +308,7 @@ void BadaSystem::initBackend() { ConfMan.registerDefault("aspect_ratio", false); ConfMan.setBool("confirm_exit", false); - Osp::System::SystemTime::GetTicks(_epoch); + SystemTime::GetTicks(_epoch); if (E_SUCCESS != initModules()) { AppLog("initModules failed"); @@ -372,7 +375,7 @@ bool BadaSystem::pollEvent(Common::Event &event) { uint32 BadaSystem::getMillis() { long long result, ticks = 0; - Osp::System::SystemTime::GetTicks(ticks); + SystemTime::GetTicks(ticks); result = ticks - _epoch; return result; } @@ -392,18 +395,18 @@ void BadaSystem::updateScreen() { void BadaSystem::getTimeAndDate(TimeDate &td) const { DateTime currentTime; - if (E_SUCCESS == Osp::System::SystemTime::GetCurrentTime(currentTime)) { + if (E_SUCCESS == SystemTime::GetCurrentTime(WALL_TIME, currentTime)) { td.tm_sec = currentTime.GetSecond(); td.tm_min = currentTime.GetMinute(); td.tm_hour = currentTime.GetHour(); td.tm_mday = currentTime.GetDay(); td.tm_mon = currentTime.GetMonth(); td.tm_year = currentTime.GetYear(); -#ifdef RELEASE_BUILD - #error getTimeAndDate() is not setting the day of the week -#else - td.tm_wday = 0; // FIXME -#endif + + Calendar *calendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN); + calendar->SetTime(currentTime); + td.tm_wday = calendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK) - 1; + delete calendar; } } |