aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb.prv@gmx.de>2019-11-12 22:37:12 +0100
committerDenis Kenzior <denkenz@gmail.com>2019-11-18 14:09:06 -0600
commit0ae5a29e821608a191230eb45da81d50c3d4ba1b (patch)
tree600bc28e85bb542b9ef98e86efe684468574d401
parentaafc7aaf606e9e44e533e642017953cb7e1bccbe (diff)
downloadphonesim-0ae5a29e821608a191230eb45da81d50c3d4ba1b.tar.gz
qwsppdu: Port to QLocale
-rw-r--r--src/qwsppdu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/qwsppdu.cpp b/src/qwsppdu.cpp
index 26f450d..f3a1661 100644
--- a/src/qwsppdu.cpp
+++ b/src/qwsppdu.cpp
@@ -18,13 +18,15 @@
****************************************************************************/
#include <qwsppdu.h>
-#include <qstringlist.h>
-#include <qtextcodec.h>
+
+#include <cstdlib>
+#include <netinet/in.h>
+#include <qbuffer.h>
#include <qdatetime.h>
+#include <qlocale.h>
#include <qiodevice.h>
-#include <qbuffer.h>
-#include <netinet/in.h>
-#include <cstdlib>
+#include <qstringlist.h>
+#include <qtextcodec.h>
// Reference: WAP-230-WSP
// Wireless Application Protocol
@@ -409,9 +411,10 @@ QString QWspDateTime::dateString(QDateTime d)
{
QDate date = d.date();
QTime time = d.time();
+ QLocale locale;
QString str;
- QByteArray dayName = date.shortDayName(date.dayOfWeek()).toUtf8();
- QByteArray monthName = date.shortMonthName(date.month()).toUtf8();
+ QByteArray dayName = locale.dayName(date.dayOfWeek(), QLocale::ShortFormat).toUtf8();
+ QByteArray monthName = locale.monthName(date.month(), QLocale::ShortFormat).toUtf8();
QByteArray utcOffs = secsToUTC(timeZoneDiff()).toUtf8();
str.asprintf("%s, %.2d %s %d %.2d:%.2d:%.2d %s",
dayName.constData(),
@@ -434,7 +437,7 @@ QString QWspDateTime::dateString(QDateTime d)
QDateTime QWspDateTime::fromGmtTime_t(quint32 t)
{
QDateTime dt;
- dt.setTime_t(t + timeZoneDiff());
+ dt.setSecsSinceEpoch(t + timeZoneDiff());
return dt;
}