From 2b55d52669beb72396f94e449fdf172735349b3b Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 10:34:03 +0200 Subject: Fix crash on startup on Symbian OS The changes to QThread introduced by commit 9aa4538b219ed759a47e8d1f93c2797bf07b5e2f mean that the QThread constructor calls into the event dispatcher. The Symbian event dispatcher owns a QThread, so it crashed when the code re-entered the partially constructed event dispatcher and used an uninitialised pointer. This change delays construction of the QThread until the point of use, so that the event dispatcher is fully constructed. Task-number: QTBUG-10029 Reviewed-by: Jason Barron --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 20 +++++++++++++++----- src/corelib/kernel/qeventdispatcher_symbian_p.h | 3 ++- 2 files changed, 17 insertions(+), 6 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; -- cgit v0.12 From 040b480b58f76ec689eea3b0f0518a0997080cc9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 20 Apr 2010 14:26:15 +0300 Subject: Fix default_deployment.pkg_prerules Due to Symbian mkspecs refactoring, some changes from 4.6 didn't get properly merged into 4.7. Task-number: QTBUG-10050 Reviewed-by: Janne Koskinen --- mkspecs/common/symbian/symbian-mmp.conf | 11 ----------- mkspecs/common/symbian/symbian.conf | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf index 507b60c..1ab228f 100644 --- a/mkspecs/common/symbian/symbian-mmp.conf +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -38,17 +38,6 @@ INCLUDEPATH = \ # RVCT seems to do this automatically, but WINSCW compiler does not, so add it here. MMP_RULES += "USERINCLUDE ." -# Supports S60 3.0, 3.1, 3.2 and 5.0 by default -default_deployment.pkg_prerules = \ - "; Default HW/platform dependencies" \ - "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ - "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ - "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ - "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ - " " - -DEPLOYMENT += default_deployment - exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { S60_VERSION = 5.0 } else { diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 1df3671..0bd0bf2 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -112,3 +112,21 @@ QMAKE_GZIP = gzip -9f QT_ARCH = symbian load(qt_config) load(symbian/platform_paths) + +# pkg_depends_webkit, pkg_depends_core, and pkg_platform_dependencies can be removed by developer +# if multiple languages need to be supported by pkg file. In that case the developer should declare +# multiple language compatible dependency statements him/herself. + +default_deployment.pkg_prerules += pkg_depends_webkit pkg_depends_qt pkg_platform_dependencies + +# Supports S60 3.0, 3.1, 3.2 and 5.0 by default +pkg_platform_dependencies = \ + "; Default HW/platform dependencies" \ + "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ + "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ + "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ + "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ + " " + +DEPLOYMENT += default_deployment + -- cgit v0.12 From 88a332f92a5c660ce934ea0132c9814de0cb02b6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 20 Apr 2010 14:36:31 +0300 Subject: Fixed vendor info in fluidlauncher sis package. Fluidlauncher was using default vendor info while all other demos used Nokia as vendor. Task-number: QTBUG-10051 Reviewed-by: Janne Koskinen --- demos/embedded/fluidlauncher/fluidlauncher.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 13274c3..c6a105e 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -57,9 +57,10 @@ wince*{ symbian { load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + RSS_RULES = # Clear RSS_RULES, otherwise fluidlauncher will get put into QtDemos folder TARGET.UID3 = 0xA000A641 - ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg defineReplace(regResourceDir) { symbian-abld|symbian-sbsv2 { -- cgit v0.12 From ddf68c92b606b609d2db270c621af4f60ea0527f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 15:35:43 +0200 Subject: Fix to collections autotest The test was checking for an implementation detail, rather than behaviour which is part of the API. With the symbian text codecs backend, this test failed because the converter returns QByteArray() for empty input (for which isNull() returns true). Reviewed-by: Thiago --- tests/auto/collections/tst_collections.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index e7b01a1..d092c34 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -2260,7 +2260,6 @@ void tst_Collections::qstring() QVERIFY(s.isNull()); QVERIFY(s.toLocal8Bit().size() == 0); QVERIFY(s.toLocal8Bit().isEmpty()); - QVERIFY(!s.toLocal8Bit().isNull()); s = "first-ascii"; QVERIFY(s.toAscii() == "first-ascii"); -- cgit v0.12 From 4a059ff9042cca4105395f26f31d96f883fa416f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 15:42:16 +0200 Subject: Fix compile error in QFileDialog autotest Reviewed-by: Trust Me --- tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 9adb4fc..38a1ee7 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -548,7 +548,7 @@ void tst_QFiledialog::completer() // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel. #if defined(Q_OS_SYMBIAN) - QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths") + QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths", SkipAll); #endif QTRY_COMPARE(cModel->rowCount(), expected); } QT_CATCH(...) { -- cgit v0.12 From 2d88a85bd6e1b03e87ff5e8c67bbef5d4a439d06 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 17:12:27 +0200 Subject: Fix test failures for qdatetime on symbian and wince Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 459d76a..36e5173 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4016,7 +4016,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(); -- cgit v0.12 From 3e05df4abe1469fb4fb04e6d26f2befb3317346e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 20 Apr 2010 17:13:59 +0200 Subject: Use a compile time constant for the C epoch as a julian day. The julian day calculation is complex, so capturing the value and storing as a compile time constant will save some calculations at runtime. Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 36e5173..c753c0b 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) @@ -2320,8 +2321,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; } -- cgit v0.12