[Scummvm-cvs-logs] scummvm master -> 7b44c20eb114515a1117df7f930ed98af0528db4
lordhoto
lordhoto at gmail.com
Mon Jun 25 20:14:33 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7b44c20eb1 BADA: Implement weekday querying in getTimeAndDate.
Commit: 7b44c20eb114515a1117df7f930ed98af0528db4
https://github.com/scummvm/scummvm/commit/7b44c20eb114515a1117df7f930ed98af0528db4
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-06-25T10:59:46-07:00
Commit Message:
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.
Changed paths:
backends/platform/bada/system.cpp
diff --git a/backends/platform/bada/system.cpp b/backends/platform/bada/system.cpp
index 816a675..3f862c2 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;
}
}
More information about the Scummvm-git-logs
mailing list