From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'microkde/kdecore/klocale.cpp') diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 1d8ae9f..dd310fa 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "kdebug.h" #include "kcalendarsystemgregorian.h" @@ -11,8 +12,8 @@ //#define COLLECT_TRANSLATION -QDict *mLocaleDict = 0; -void setLocaleDict( QDict * dict ) +Q3Dict *mLocaleDict = 0; +void setLocaleDict( Q3Dict * dict ) { mLocaleDict = dict; @@ -45,7 +46,7 @@ void addExist(const char *text,QString trans ) } #include -#include +#include #include #endif void dumpMissing() @@ -53,10 +54,10 @@ void dumpMissing() #ifdef COLLECT_TRANSLATION QString fileName = "/tmp/usernewtrans.txt"; QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); int i; @@ -70,10 +71,10 @@ void dumpMissing() { QString fileName = "/tmp/usertrans.txt"; QFile file( fileName ); - if (!file.open( IO_WriteOnly ) ) { + if (!file.open( QIODevice::WriteOnly ) ) { return ; } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); int i; @@ -467,7 +468,7 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime, format = "%1 %2"; else if ( intIntDateFormat == Format1 ) format = "%1 %2"; - else if ( intIntDateFormat == ISODate ) + else if ( intIntDateFormat == Qt::ISODate ) format = "%1T%2"; QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) @@ -527,7 +528,7 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con strpos++; c = fmt.at(fmtpos++); - switch (c) + switch (c.unicode()) { case 'a': case 'A': @@ -638,7 +639,7 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const strpos++; c = Format.at(Formatpos++); - switch (c) + switch (c.unicode()) { case 'p': { @@ -734,7 +735,7 @@ QDateTime KLocale::readDateTime(const QString &intstr, QString tformat = timeFormat(intIntDateFormat); QDate m_date = readDate(date, dformat, &ok1); - QTime m_time = readTime(time, tformat, &ok2); + QTime m_time = readTime(time, !tformat.isEmpty(), &ok2); QDateTime m_dt; -- cgit v0.9.0.2