diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-06-01 22:55:19 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-06-01 22:55:19 (GMT) |
commit | 0548b4f69d95dbd992cf60c8ab0f1225523b15e1 (patch) | |
tree | a3669b4d755cc1721681e424513ec7801146b2b3 | |
parent | 73fc68802d8c0c8d3d499b279782ce270f1c5bc6 (diff) | |
parent | e9ab8493053a7dd56cde058e736f46feafb378d0 (diff) | |
download | Qt-0548b4f69d95dbd992cf60c8ab0f1225523b15e1.zip Qt-0548b4f69d95dbd992cf60c8ab0f1225523b15e1.tar.gz Qt-0548b4f69d95dbd992cf60c8ab0f1225523b15e1.tar.bz2 |
Merge remote branch 'origin/4.7' into 4.8-from-4.7
Conflicts:
src/declarative/declarative.pro
tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
-rw-r--r-- | src/declarative/declarative.pro | 2 | ||||
-rw-r--r-- | src/declarative/qml/qperformancetimer.cpp | 55 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 6 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.cpp | 15 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp | 44 | ||||
-rw-r--r-- | tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 29 |
8 files changed, 46 insertions, 118 deletions
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index b74b18c..055e4b9 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -26,7 +26,7 @@ include(debugger/debugger.pri) symbian: { TARGET.UID3=0x2001E623 - LIBS += -lefsrv + LIBS += -lefsrv -lhal contains(QT_CONFIG, freetype) { DEFINES += QT_NO_FONTCONFIG diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp index 9fc0d35..659a339 100644 --- a/src/declarative/qml/qperformancetimer.cpp +++ b/src/declarative/qml/qperformancetimer.cpp @@ -45,14 +45,15 @@ #include <sys/time.h> #include <unistd.h> #include <mach/mach_time.h> -#elif defined(Q_OS_UNIX) -#include <sys/time.h> -#include <time.h> -#include <unistd.h> #elif defined(Q_OS_SYMBIAN) #include <e32std.h> #include <sys/time.h> #include <hal.h> +#include <hal_data.h> +#elif defined(Q_OS_UNIX) +#include <sys/time.h> +#include <time.h> +#include <unistd.h> #elif defined(Q_OS_WIN) #include <windows.h> #endif @@ -84,6 +85,29 @@ qint64 QPerformanceTimer::elapsed() const return absoluteToNSecs(cpu_time - t1); } +////////////////////////////// Symbian ////////////////////////////// +#elif defined(Q_OS_SYMBIAN) + +static qint64 getTimeFromTick(quint64 elapsed) +{ + static TInt freq = 0; + if (!freq) + HAL::Get(HALData::EFastCounterFrequency, freq); + + return (elapsed * 1000000000) / freq; +} + +void QPerformanceTimer::start() +{ + t1 = User::FastCounter(); +} + +qint64 QPerformanceTimer::elapsed() const +{ + return getTimeFromTick(User::FastCounter() - t1); +} + + ////////////////////////////// Unix ////////////////////////////// #elif defined(Q_OS_UNIX) @@ -158,29 +182,6 @@ qint64 QPerformanceTimer::elapsed() const return sec * Q_INT64_C(1000000000) + frac; } -////////////////////////////// Symbian ////////////////////////////// -#elif defined(Q_OS_SYMBIAN) - -static qint64 getTimeFromTick(quint64 elapsed) -{ - static TInt freq; - if (!freq) - HAL::Get(HALData::EFastCounterFrequency, freq); - - // ### not sure on units - return elapsed / freq; -} - -void QPerformanceTimer::start() -{ - t1 = User::FastCounter(); -} - -qint64 QPerformanceTimer::elapsed() const -{ - return getTimeFromTick(User::FastCounter() - t1); -} - ////////////////////////////// Windows ////////////////////////////// #elif defined(Q_OS_WIN) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 634cf00..91f3efa 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -106,10 +106,10 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** {5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, {5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, -{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,3,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,3,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}, -{9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} +{9,0,-909,0,0,2,0,5,-1,30,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,2,2,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} // *** End of generated data *** }; diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 54cd898..d468bc4 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -385,6 +385,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer))); connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)), this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer))); + + QMetaObject::invokeMethod(engine, "initialize"); } } @@ -408,19 +410,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() startPolling(); } - if (firstUpdate) { + if (firstUpdate) firstUpdate = false; - QList<QBearerEngine*> enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex - Qt::ConnectionType connectionType; - if (QCoreApplicationPrivate::mainThread() == QThread::currentThread()) - connectionType = Qt::DirectConnection; - else - connectionType = Qt::BlockingQueuedConnection; - locker.unlock(); - foreach (QBearerEngine* engine, enginesToInitialize) { - QMetaObject::invokeMethod(engine, "initialize", connectionType); - } - } } void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index fb41b7c..599c3f6 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1338,9 +1338,9 @@ bool QSslSocketBackendPrivate::startHandshake() sslErrors.clear(); } - // if we have a max read buffer size, reset the plain socket's to 1k + // if we have a max read buffer size, reset the plain socket's to 16k if (readBufferMaxSize) - plainSocket->setReadBufferSize(1024); + plainSocket->setReadBufferSize(16384); connectionEncrypted = true; emit q->encrypted(); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 9b7b228..4bcd19b 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -8029,7 +8029,16 @@ void tst_QGraphicsItem::sorting() QGraphicsView view(&scene); view.setResizeAnchor(QGraphicsView::NoAnchor); view.setTransformationAnchor(QGraphicsView::NoAnchor); +#ifdef Q_OS_SYMBIAN + // Adjust area in devices where scrollbars are thicker than 25 pixels as they will + // obstruct painting otherwise. + int scrollWidth = qMax(25, view.verticalScrollBar()->width()); + int scrollHeight = qMax(25, view.horizontalScrollBar()->height()); + + view.resize(95 + scrollWidth, 75 + scrollHeight); +#else view.resize(120, 100); +#endif view.setFrameStyle(0); view.show(); #ifdef Q_WS_X11 diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp index d29ef77..57bf583 100644 --- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp +++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp @@ -62,7 +62,6 @@ public slots: void cleanup(); private slots: - void usedInThread(); // this test must be first, or it will falsely pass void allConfigurations(); void defaultConfiguration(); void configurationFromIdentifier(); @@ -330,49 +329,6 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier() QVERIFY(!invalid.isValid()); } -class QNCMTestThread : public QThread -{ -protected: - virtual void run() - { - QNetworkConfigurationManager manager; - preScanConfigs = manager.allConfigurations(); - QSignalSpy spy(&manager, SIGNAL(updateCompleted())); - manager.updateConfigurations(); //initiate scans - QTRY_VERIFY(spy.count() == 1); //wait for scan to complete - configs = manager.allConfigurations(); - } -public: - QList<QNetworkConfiguration> configs; - QList<QNetworkConfiguration> preScanConfigs; -}; - -// regression test for QTBUG-18795 -void tst_QNetworkConfigurationManager::usedInThread() -{ -#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN) - QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll); -#else - QNCMTestThread thread; - connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - thread.start(); - QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread - QVERIFY(!QTestEventLoop::instance().timeout()); - qDebug() << "prescan:" << thread.preScanConfigs.count(); - qDebug() << "postscan:" << thread.configs.count(); - - QNetworkConfigurationManager manager; - QList<QNetworkConfiguration> preScanConfigs = manager.allConfigurations(); - QSignalSpy spy(&manager, SIGNAL(updateCompleted())); - manager.updateConfigurations(); //initiate scans - QTRY_VERIFY(spy.count() == 1); //wait for scan to complete - QList<QNetworkConfiguration> configs = manager.allConfigurations(); - QCOMPARE(thread.configs, configs); - //Don't compare pre scan configs, because these may be cached and therefore give different results - //which makes the test unstable. The post scan results should have all configurations every time - //QCOMPARE(thread.preScanConfigs, preScanConfigs); -#endif -} QTEST_MAIN(tst_QNetworkConfigurationManager) #include "tst_qnetworkconfigurationmanager.moc" diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 136d4d8..45464ca 100644 --- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -41,12 +41,10 @@ #include <QtTest/QTest> -#include <QtTest/QTestEventLoop> #include <qcoreapplication.h> #include <qdebug.h> #include <qnetworkproxy.h> -#include <QThread> #include <QNetworkConfiguration> #include <QNetworkConfigurationManager> #include <QNetworkSession> @@ -78,7 +76,6 @@ public: }; private slots: - void systemProxyForQueryCalledFromThread(); void systemProxyForQuery() const; #ifndef QT_NO_BEARERMANAGEMENT void fromConfigurations(); @@ -138,32 +135,6 @@ void tst_QNetworkProxyFactory::systemProxyForQuery() const QFAIL("One or more system proxy lookup failures occurred."); } -class QSPFQThread : public QThread -{ -protected: - virtual void run() - { - proxies = QNetworkProxyFactory::systemProxyForQuery(query); - } -public: - QNetworkProxyQuery query; - QList<QNetworkProxy> proxies; -}; - -//regression test for QTBUG-18799 -void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread() -{ - QUrl url(QLatin1String("http://qt.nokia.com")); - QNetworkProxyQuery query(url); - QSPFQThread thread; - thread.query = query; - connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - thread.start(); - QTestEventLoop::instance().enterLoop(5); - QVERIFY(thread.isFinished()); - QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query)); -} - #ifndef QT_NO_BEARERMANAGEMENT //Purpose of this test is just to check systemProxyForQuery doesn't hang or crash |