diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-20 18:49:59 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-20 18:49:59 (GMT) |
commit | 4de2d16377e820f37325a3f4e219af778042122f (patch) | |
tree | d638cfdf04f56d36f008015a04e003794f54302a /src/corelib/tools | |
parent | 4676dd62871da2b58452ebda477a04c25158bec4 (diff) | |
parent | 3e05df4abe1469fb4fb04e6d26f2befb3317346e (diff) | |
download | Qt-4de2d16377e820f37325a3f4e219af778042122f.zip Qt-4de2d16377e820f37325a3f4e219af778042122f.tar.gz Qt-4de2d16377e820f37325a3f4e219af778042122f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Use a compile time constant for the C epoch as a julian day.
Fix test failures for qdatetime on symbian and wince
Fix compile error in QFileDialog autotest
Fix to collections autotest
Fixed vendor info in fluidlauncher sis package.
Fix default_deployment.pkg_prerules
Fix crash on startup on Symbian OS
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index c12095f..9afcd80 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -88,7 +88,8 @@ enum { SECS_PER_HOUR = 3600, MSECS_PER_HOUR = 3600000, SECS_PER_MIN = 60, - MSECS_PER_MIN = 60000 + MSECS_PER_MIN = 60000, + JULIAN_DAY_FOR_EPOCH = 2440588 // result of julianDayFromGregorianDate(1970, 1, 1) }; static inline QDate fixedDate(int y, int m, int d) @@ -2321,8 +2322,8 @@ void QDateTime::setTimeSpec(Qt::TimeSpec spec) qint64 toMSecsSinceEpoch_helper(qint64 jd, int msecs) { - int days = jd - julianDayFromGregorianDate(1970, 1, 1); - qint64 retval = (qlonglong(days) * MSECS_PER_DAY) + msecs; + qint64 days = jd - JULIAN_DAY_FOR_EPOCH; + qint64 retval = (days * MSECS_PER_DAY) + msecs; return retval; } @@ -4017,7 +4018,7 @@ static void localToUtc(QDate &date, QTime &time, int isdst) localTM.tm_year = fakeDate.year() - 1900; localTM.tm_isdst = (int)isdst; #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) - time_t secsSince1Jan1970UTC = toMSecsSinceEpoch_helper(fakeDate.toJulianDay(), QTime().msecsTo(time)); + time_t secsSince1Jan1970UTC = (toMSecsSinceEpoch_helper(fakeDate.toJulianDay(), QTime().msecsTo(time)) / 1000); #else #if defined(Q_OS_WIN) _tzset(); |