summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-20 18:49:59 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-20 18:49:59 (GMT)
commit4de2d16377e820f37325a3f4e219af778042122f (patch)
treed638cfdf04f56d36f008015a04e003794f54302a /src
parent4676dd62871da2b58452ebda477a04c25158bec4 (diff)
parent3e05df4abe1469fb4fb04e6d26f2befb3317346e (diff)
downloadQt-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')
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp20
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h3
-rw-r--r--src/corelib/tools/qdatetime.cpp9
3 files changed, 22 insertions, 10 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 8c96057..3b86e89 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -638,6 +638,7 @@ void QSocketActiveObject::deleteLater()
QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent)
: QAbstractEventDispatcher(parent),
+ m_selectThread(0),
m_activeScheduler(0),
m_wakeUpAO(0),
m_completeDeferredAOs(0),
@@ -665,11 +666,19 @@ void QEventDispatcherSymbian::startingUp()
wakeUp();
}
+QSelectThread& QEventDispatcherSymbian::selectThread() {
+ if (!m_selectThread)
+ m_selectThread = new QSelectThread;
+ return *m_selectThread;
+}
+
void QEventDispatcherSymbian::closingDown()
{
- if (m_selectThread.isRunning()) {
- m_selectThread.stop();
+ if (m_selectThread && m_selectThread->isRunning()) {
+ m_selectThread->stop();
}
+ delete m_selectThread;
+ m_selectThread = 0;
delete m_completeDeferredAOs;
delete m_wakeUpAO;
@@ -941,12 +950,13 @@ void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifie
{
QSocketActiveObject *socketAO = q_check_ptr(new QSocketActiveObject(this, notifier));
m_notifiers.insert(notifier, socketAO);
- m_selectThread.requestSocketEvents(notifier, &socketAO->iStatus);
+ selectThread().requestSocketEvents(notifier, &socketAO->iStatus);
}
void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notifier )
{
- m_selectThread.cancelSocketEvents(notifier);
+ if (m_selectThread)
+ m_selectThread->cancelSocketEvents(notifier);
if (m_notifiers.contains(notifier)) {
QSocketActiveObject *sockObj = *m_notifiers.find(notifier);
m_deferredSocketEvents.removeAll(sockObj);
@@ -957,7 +967,7 @@ void QEventDispatcherSymbian::unregisterSocketNotifier ( QSocketNotifier * notif
void QEventDispatcherSymbian::reactivateSocketNotifier(QSocketNotifier *notifier)
{
- m_selectThread.requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus);
+ selectThread().requestSocketEvents(notifier, &m_notifiers[notifier]->iStatus);
}
void QEventDispatcherSymbian::registerTimer ( int timerId, int interval, QObject * object )
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 1ab31cc..5281199 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -259,8 +259,9 @@ private:
bool sendPostedEvents();
bool sendDeferredSocketEvents();
+ QSelectThread& selectThread();
private:
- QSelectThread m_selectThread;
+ QSelectThread *m_selectThread;
CQtActiveScheduler *m_activeScheduler;
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();