summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-06 13:15:46 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-06 13:15:46 (GMT)
commit972b867ff2cf3412d94aadf5099064eabcf7507d (patch)
treeca31dab87ca758e619618959f783f28fcba43c68 /src/script
parent191e3d02a524f25d22db4b471864c64e029ca9df (diff)
downloadQt-972b867ff2cf3412d94aadf5099064eabcf7507d.zip
Qt-972b867ff2cf3412d94aadf5099064eabcf7507d.tar.gz
Qt-972b867ff2cf3412d94aadf5099064eabcf7507d.tar.bz2
kill dead code
Diffstat (limited to 'src/script')
-rw-r--r--src/script/utils/qscriptdate.cpp134
1 files changed, 0 insertions, 134 deletions
diff --git a/src/script/utils/qscriptdate.cpp b/src/script/utils/qscriptdate.cpp
index 5e8a771..f0b6172 100644
--- a/src/script/utils/qscriptdate.cpp
+++ b/src/script/utils/qscriptdate.cpp
@@ -304,25 +304,6 @@ static inline qsreal UTC(qsreal t)
return t - LocalTZA - DaylightSavingTA(t - LocalTZA);
}
-static inline qsreal currentTime()
-{
-#ifndef Q_WS_WIN
- struct timeval tv;
-
- gettimeofday(&tv, 0);
- return ::floor(tv.tv_sec * msPerSecond + (tv.tv_usec / 1000.0));
-#else
- SYSTEMTIME st;
- GetSystemTime(&st);
- FILETIME ft;
- SystemTimeToFileTime(&st, &ft);
- LARGE_INTEGER li;
- li.LowPart = ft.dwLowDateTime;
- li.HighPart = ft.dwHighDateTime;
- return double(li.QuadPart - Q_INT64_C(116444736000000000)) / 10000.0;
-#endif
-}
-
static inline qsreal TimeClip(qsreal t)
{
if (! qIsFinite(t) || fabs(t) > 8.64e15)
@@ -330,121 +311,6 @@ static inline qsreal TimeClip(qsreal t)
return ToInteger(t);
}
-static inline qsreal ParseString(const QString &s)
-{
- QDateTime dt = QDateTime::fromString(s, Qt::TextDate);
- if (!dt.isValid())
- dt = QDateTime::fromString(s, Qt::ISODate);
- if (!dt.isValid()) {
- QStringList formats;
- formats << QLatin1String("M/d/yyyy")
- << QLatin1String("M/d/yyyy hh:mm")
- << QLatin1String("M/d/yyyy hh:mm A")
-
- << QLatin1String("M/d/yyyy, hh:mm")
- << QLatin1String("M/d/yyyy, hh:mm A")
-
- << QLatin1String("MMM d yyyy")
- << QLatin1String("MMM d yyyy hh:mm")
- << QLatin1String("MMM d yyyy hh:mm:ss")
- << QLatin1String("MMM d yyyy, hh:mm")
- << QLatin1String("MMM d yyyy, hh:mm:ss")
-
- << QLatin1String("MMMM d yyyy")
- << QLatin1String("MMMM d yyyy hh:mm")
- << QLatin1String("MMMM d yyyy hh:mm:ss")
- << QLatin1String("MMMM d yyyy, hh:mm")
- << QLatin1String("MMMM d yyyy, hh:mm:ss")
-
- << QLatin1String("MMM d, yyyy")
- << QLatin1String("MMM d, yyyy hh:mm")
- << QLatin1String("MMM d, yyyy hh:mm:ss")
-
- << QLatin1String("MMMM d, yyyy")
- << QLatin1String("MMMM d, yyyy hh:mm")
- << QLatin1String("MMMM d, yyyy hh:mm:ss")
-
- << QLatin1String("d MMM yyyy")
- << QLatin1String("d MMM yyyy hh:mm")
- << QLatin1String("d MMM yyyy hh:mm:ss")
- << QLatin1String("d MMM yyyy, hh:mm")
- << QLatin1String("d MMM yyyy, hh:mm:ss")
-
- << QLatin1String("d MMMM yyyy")
- << QLatin1String("d MMMM yyyy hh:mm")
- << QLatin1String("d MMMM yyyy hh:mm:ss")
- << QLatin1String("d MMMM yyyy, hh:mm")
- << QLatin1String("d MMMM yyyy, hh:mm:ss")
-
- << QLatin1String("d MMM, yyyy")
- << QLatin1String("d MMM, yyyy hh:mm")
- << QLatin1String("d MMM, yyyy hh:mm:ss")
-
- << QLatin1String("d MMMM, yyyy")
- << QLatin1String("d MMMM, yyyy hh:mm")
- << QLatin1String("d MMMM, yyyy hh:mm:ss");
-
- for (int i = 0; i < formats.size(); ++i) {
- dt = QDateTime::fromString(s, formats.at(i));
- if (dt.isValid())
- break;
- }
- }
- return FromDateTime(dt);
-}
-
-static inline QString ToString(qsreal t)
-{
- if (qIsNaN(t))
- return QLatin1String("Invalid Date");
- QString str = ToDateTime(t, Qt::LocalTime).toString() + QLatin1String(" GMT");
- qsreal tzoffset = LocalTZA + DaylightSavingTA(t);
- if (tzoffset) {
- int hours = tzoffset / 1000 / 60 / 60;
- int mins = int(tzoffset / 1000 / 60) % 60;
- str.append(QLatin1Char((tzoffset > 0) ? '+' : '-'));
- if (hours < 10)
- str.append(QLatin1Char('0'));
- str.append(QString::number(hours));
- if (mins < 10)
- str.append(QLatin1Char('0'));
- str.append(QString::number(mins));
- }
- return str;
-}
-
-static inline QString ToUTCString(qsreal t)
-{
- if (qIsNaN(t))
- return QLatin1String("Invalid Date");
- return ToDateTime(t, Qt::UTC).toString() + QLatin1String(" GMT");
-}
-
-static inline QString ToDateString(qsreal t)
-{
- return ToDateTime(t, Qt::LocalTime).date().toString();
-}
-
-static inline QString ToTimeString(qsreal t)
-{
- return ToDateTime(t, Qt::LocalTime).time().toString();
-}
-
-static inline QString ToLocaleString(qsreal t)
-{
- return ToDateTime(t, Qt::LocalTime).toString(Qt::LocaleDate);
-}
-
-static inline QString ToLocaleDateString(qsreal t)
-{
- return ToDateTime(t, Qt::LocalTime).date().toString(Qt::LocaleDate);
-}
-
-static inline QString ToLocaleTimeString(qsreal t)
-{
- return ToDateTime(t, Qt::LocalTime).time().toString(Qt::LocaleDate);
-}
-
static qsreal getLocalTZA()
{
#ifndef Q_WS_WIN