diff options
Diffstat (limited to 'kpf/src/Utils.cpp')
-rw-r--r-- | kpf/src/Utils.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kpf/src/Utils.cpp b/kpf/src/Utils.cpp index a867a998..08f3318a 100644 --- a/kpf/src/Utils.cpp +++ b/kpf/src/Utils.cpp @@ -24,8 +24,8 @@ #include <ctime> #include <clocale> -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> #include <klocale.h> @@ -36,11 +36,11 @@ namespace KPF { static bool dateInitDone = false; - static QStringList monthList; + static TQStringList monthList; static const char rfc1123Format[] = "%a, %d %b %Y %H:%M:%S GMT"; - static time_t qDateTimeToTimeT(const QDateTime & t) + static time_t qDateTimeToTimeT(const TQDateTime & t) { struct tm tempTm; @@ -52,7 +52,7 @@ namespace KPF tempTm.tm_sec = t.time().second(); tempTm.tm_isdst = -1; - // Fix up differences between QDateTime and tm. + // Fix up differences between TQDateTime and tm. tempTm.tm_year -= 1900; @@ -62,18 +62,18 @@ namespace KPF } QDateTime - toGMT(const QDateTime & dt) + toGMT(const TQDateTime & dt) { time_t dtAsTimeT = qDateTimeToTimeT(dt); struct tm * dtAsGmTm = ::gmtime(&dtAsTimeT); if (0 == dtAsGmTm) - return QDateTime(); + return TQDateTime(); time_t dtAsGmTimeT = ::mktime(dtAsGmTm); - QDateTime ret; + TQDateTime ret; ret.setTime_t(dtAsGmTimeT); @@ -103,13 +103,13 @@ namespace KPF ; } - QString dateString() + TQString dateString() { - return dateString(QDateTime::currentDateTime()); + return dateString(TQDateTime::currentDateTime()); } - QString dateString(const QDateTime & t) + TQString dateString(const TQDateTime & t) { time_t asTimeT = qDateTimeToTimeT(t); @@ -118,7 +118,7 @@ namespace KPF if (0 == asTm) { kpfDebug << "::gmtime() failed" << endl; - return QString::null; + return TQString::null; } asTm->tm_isdst = -1; @@ -129,25 +129,25 @@ namespace KPF // Ensure we use locale "C" for strftime. - QCString oldLC_ALL = ::strdup(::setlocale(LC_TIME, "C")); - QCString oldLC_TIME = ::strdup(::setlocale(LC_ALL, "C")); + TQCString oldLC_ALL = ::strdup(::setlocale(LC_TIME, "C")); + TQCString oldLC_TIME = ::strdup(::setlocale(LC_ALL, "C")); { ::strftime(static_cast<char *>(buf), len, rfc1123Format, asTm); } ::setlocale(LC_TIME, oldLC_TIME.data()); ::setlocale(LC_ALL, oldLC_ALL.data()); - return QString::fromUtf8(buf); + return TQString::fromUtf8(buf); } bool - parseDate(const QString & s, QDateTime & dt) + parseDate(const TQString & s, TQDateTime & dt) { dateInit(); // kpfDebug << "Parsing date `" << s << "'" << endl; - QStringList l(QStringList::split(' ', s)); + TQStringList l(TQStringList::split(' ', s)); switch (l.count()) { @@ -173,7 +173,7 @@ namespace KPF } bool - parseDateRFC1123(const QStringList & l, QDateTime & dt) + parseDateRFC1123(const TQStringList & l, TQDateTime & dt) { if ("GMT" != l[5]) return false; @@ -183,7 +183,7 @@ namespace KPF bool haveMonth = false; uint month = 0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = monthList.begin(); it != monthList.end(); ++it) { @@ -201,7 +201,7 @@ namespace KPF uint year(l[3].toUInt()); - QStringList timeTokenList(QStringList::split(':', l[4])); + TQStringList timeTokenList(TQStringList::split(':', l[4])); if (3 != timeTokenList.count()) return false; @@ -210,19 +210,19 @@ namespace KPF uint minutes (timeTokenList[1].toUInt()); uint seconds (timeTokenList[2].toUInt()); - dt.setDate(QDate(year, month + 1, day)); - dt.setTime(QTime(hours, minutes, seconds)); + dt.setDate(TQDate(year, month + 1, day)); + dt.setTime(TQTime(hours, minutes, seconds)); return dt.isValid(); } bool - parseDateRFC850(const QStringList & l, QDateTime & dt) + parseDateRFC850(const TQStringList & l, TQDateTime & dt) { if ("GMT" != l[3]) return false; - QStringList dateTokenList(QStringList::split('-', l[1])); + TQStringList dateTokenList(TQStringList::split('-', l[1])); if (3 != dateTokenList.count()) return false; @@ -232,7 +232,7 @@ namespace KPF bool haveMonth = false; uint month = 0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = monthList.begin(); it != monthList.end(); ++it) { @@ -255,7 +255,7 @@ namespace KPF else if (year < 100) year += 1900; - QStringList timeTokenList(QStringList::split(':', l[2])); + TQStringList timeTokenList(TQStringList::split(':', l[2])); if (3 != timeTokenList.count()) return false; @@ -264,19 +264,19 @@ namespace KPF uint minutes (timeTokenList[1].toUInt()); uint seconds (timeTokenList[2].toUInt()); - dt.setDate(QDate(year, month + 1, day)); - dt.setTime(QTime(hours, minutes, seconds)); + dt.setDate(TQDate(year, month + 1, day)); + dt.setTime(TQTime(hours, minutes, seconds)); return dt.isValid(); } bool - parseDateAscTime(const QStringList & l, QDateTime & dt) + parseDateAscTime(const TQStringList & l, TQDateTime & dt) { bool haveMonth = false; uint month = 0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = monthList.begin(); it != monthList.end(); ++it) { @@ -294,7 +294,7 @@ namespace KPF uint day(l[2].toUInt()); - QStringList timeTokenList(QStringList::split(':', l[3])); + TQStringList timeTokenList(TQStringList::split(':', l[3])); if (3 != timeTokenList.count()) return false; @@ -305,8 +305,8 @@ namespace KPF uint year(l[4].toUInt()); - dt.setDate(QDate(year, month + 1, day)); - dt.setTime(QTime(hours, minutes, seconds)); + dt.setDate(TQDate(year, month + 1, day)); + dt.setTime(TQTime(hours, minutes, seconds)); return dt.isValid(); } @@ -314,7 +314,7 @@ namespace KPF QString translatedResponseName(uint code) { - QString s; + TQString s; switch (code) { @@ -362,7 +362,7 @@ namespace KPF QString responseName(uint code) { - QString s; + TQString s; switch (code) { |