From 9a5fb6bd5f0fb3b37897bf722e4cc1673309623c Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Wed, 30 Nov 2011 13:36:40 +0200 Subject: Fix sqlite driver memory eating due to close failure If an ongoing query is not finalized before close function is called, sqlite driver still tries to close the connection to sqlite. In this case, sqlite reports an error to sqlite driver which is not reported to the client. The failure in close causes connection to sqlite unclosed and memory is not freed. This fix tries to finalize all queries before close function is called. The close function should succeed. Task-number: QTBUG-16967 Reviewed-by: Charles Yin --- src/sql/drivers/sqlite/qsql_sqlite.cpp | 7 +++++ tests/auto/qsqlquery/tst_qsqlquery.cpp | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 8294a55..38e4a63 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -104,6 +104,7 @@ class QSQLiteDriverPrivate public: inline QSQLiteDriverPrivate() : access(0) {} sqlite3 *access; + QList results; }; @@ -286,10 +287,12 @@ QSQLiteResult::QSQLiteResult(const QSQLiteDriver* db) { d = new QSQLiteResultPrivate(this); d->access = db->d->access; + db->d->results.append(this); } QSQLiteResult::~QSQLiteResult() { + qobject_cast(driver())->d->results.removeOne(this); d->cleanup(); delete d; } @@ -553,6 +556,10 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c void QSQLiteDriver::close() { if (isOpen()) { + foreach (QSQLiteResult *result, d->results) { + result->d->finalize(); + } + if (sqlite3_close(d->access) != SQLITE_OK) setLastError(qMakeError(d->access, tr("Error closing database"), QSqlError::ConnectionError)); diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 3cbdb63..652a82e 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -215,6 +215,8 @@ private slots: void QTBUG_14132(); void QTBUG_21884_data() { generic_data("QSQLITE"); } void QTBUG_21884(); + void QTBUG_16967_data() { generic_data("QSQLITE"); } + void QTBUG_16967(); //clean close void sqlite_constraint_data() { generic_data("QSQLITE"); } void sqlite_constraint(); @@ -3150,6 +3152,53 @@ void tst_QSqlQuery::QTBUG_21884() } } +/** + * This test case test sqlite driver close function. Sqlite driver should close cleanly + * even if there is still outstanding prepared statement. + */ +void tst_QSqlQuery::QTBUG_16967() +{ + QFETCH(QString, dbName); + { + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + db.close(); + QCOMPARE(db.lastError().type(), QSqlError::NoError); + } + { + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + QSqlQuery q(db); + q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);"); + db.close(); + QCOMPARE(db.lastError().type(), QSqlError::NoError); + } + { + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + QSqlQuery q(db); + q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);"); + q.exec(); + db.close(); + QCOMPARE(db.lastError().type(), QSqlError::NoError); + } + { + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + QSqlQuery q(db); + q.exec("INSERT INTO t1 (id, str) VALUES(1, \"test1\");"); + db.close(); + QCOMPARE(db.lastError().type(), QSqlError::NoError); + } + { + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + QSqlQuery q(db); + q.exec("SELECT * FROM t1;"); + db.close(); + QCOMPARE(db.lastError().type(), QSqlError::NoError); + } +} void tst_QSqlQuery::oraOCINumber() { -- cgit v0.12 From 8752faf0564bed86396b01529dc8ef5064150f4c Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 30 Nov 2011 14:41:39 +0200 Subject: Fix memory leaks in OpenVG and OpenGL resource pools Task-number: QTBUG-22743 Reviewed-by: Murray Read --- src/opengl/qgltexturepool.cpp | 6 ++---- src/openvg/qvgimagepool.cpp | 13 ++----------- src/openvg/qvgimagepool_p.h | 4 ---- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp index 9ad66f2..d19b1db 100644 --- a/src/opengl/qgltexturepool.cpp +++ b/src/opengl/qgltexturepool.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE Q_OPENGL_EXPORT extern QGLWidget* qt_gl_share_widget(); -static QGLTexturePool *qt_gl_texture_pool = 0; +Q_GLOBAL_STATIC(QGLTexturePool, qt_gl_texture_pool) class QGLTexturePoolPrivate { @@ -69,9 +69,7 @@ QGLTexturePool::~QGLTexturePool() QGLTexturePool *QGLTexturePool::instance() { - if (!qt_gl_texture_pool) - qt_gl_texture_pool = new QGLTexturePool(); - return qt_gl_texture_pool; + return qt_gl_texture_pool(); } GLuint QGLTexturePool::createTexture(GLenum target, diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp index 3a187b0..cd1caf4 100644 --- a/src/openvg/qvgimagepool.cpp +++ b/src/openvg/qvgimagepool.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE -static QVGImagePool *qt_vg_image_pool = 0; +Q_GLOBAL_STATIC(QVGImagePool, qt_vg_image_pool) class QVGImagePoolPrivate { @@ -66,16 +66,7 @@ QVGImagePool::~QVGImagePool() QVGImagePool *QVGImagePool::instance() { - if (!qt_vg_image_pool) - qt_vg_image_pool = new QVGImagePool(); - return qt_vg_image_pool; -} - -void QVGImagePool::setImagePool(QVGImagePool *pool) -{ - if (qt_vg_image_pool != pool) - delete qt_vg_image_pool; - qt_vg_image_pool = pool; + return qt_vg_image_pool(); } VGImage QVGImagePool::createTemporaryImage(VGImageFormat format, diff --git a/src/openvg/qvgimagepool_p.h b/src/openvg/qvgimagepool_p.h index 07c57bf..e4fd4e1 100644 --- a/src/openvg/qvgimagepool_p.h +++ b/src/openvg/qvgimagepool_p.h @@ -69,10 +69,6 @@ public: static QVGImagePool *instance(); - // This function can be used from system-specific graphics system - // plugins to alter the image allocation strategy. - static void setImagePool(QVGImagePool *pool); - // Create a new VGImage from the pool with the specified parameters // that is not associated with a pixmap. The VGImage is returned to // the pool when releaseImage() is called. -- cgit v0.12 From 9b40e102cc76666dfa76a7b0e3d1339d672d8a95 Mon Sep 17 00:00:00 2001 From: Ari Lehtola Date: Tue, 29 Nov 2011 10:08:05 +0200 Subject: CBA comes on top of option menu Layout has changed so that option menu starts from bottom of screen. CBA is set behind in this case Reviewed-by: Miikka Heikkinen Task-number: ou1cimx1#932398 --- src/gui/kernel/qsoftkeymanager_s60.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 999fccc..4d58baa 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -104,8 +104,13 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG { RDrawableWindow *cbaWindow = cba.DrawableWindow(); Q_ASSERT_X(cbaWindow, Q_FUNC_INFO, "Native CBA does not have window!"); - // Make sure CBA is visible, i.e. CBA window is on top - cbaWindow->SetOrdinalPosition(0); + // CBA comes on top of new option menu + int pos = 0; + + if(cba.ButtonGroupType()== SLafButtonGroupContainer::ECba) + pos = 1; + + cbaWindow->SetOrdinalPosition(pos); // Qt shares same CBA instance between top-level widgets, // make sure we are not faded by underlying window. cbaWindow->SetFaded(EFalse, RWindowTreeNode::EFadeIncludeChildren); -- cgit v0.12 From e443cd2cfead3d0d6c53adcd4366cc18bd253096 Mon Sep 17 00:00:00 2001 From: Marko Kenttala Date: Wed, 30 Nov 2011 09:57:47 +0200 Subject: Lightmaps demo Symbian fix Enabling night mode does not work on Symbian devices as it uses difference composition mode which is not available. Application changed to use raster graphics engine which supports difference composition mode. Task-number: ou1cimx1#932185 Reviewed-by: Murray Read --- demos/embedded/lightmaps/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/embedded/lightmaps/main.cpp b/demos/embedded/lightmaps/main.cpp index 85f74e6..f9b6fb0 100644 --- a/demos/embedded/lightmaps/main.cpp +++ b/demos/embedded/lightmaps/main.cpp @@ -44,7 +44,7 @@ int main(int argc, char **argv) { -#if defined(Q_WS_X11) +#if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN) QApplication::setGraphicsSystem("raster"); #endif -- cgit v0.12 From be34b17416535a3bd257398e089ad285ee3a2d77 Mon Sep 17 00:00:00 2001 From: Satyam Bandarapu Date: Mon, 28 Nov 2011 16:25:14 +0200 Subject: Freezing Def files in Qt Adding unfrozen exports to def files in Qt Reviewed-by: mread --- src/s60installs/bwins/QtCoreu.def | 1 + src/s60installs/bwins/QtGuiu.def | 9 ++++++++- src/s60installs/bwins/QtNetworku.def | 2 ++ src/s60installs/bwins/QtOpenGLu.def | 2 ++ src/s60installs/eabi/QtCoreu.def | 1 + src/s60installs/eabi/QtGuiu.def | 7 +++++++ src/s60installs/eabi/QtNetworku.def | 2 ++ src/s60installs/eabi/QtOpenGLu.def | 1 + 8 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index 9181dd7..08c67e0 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4885,4 +4885,5 @@ EXPORTS ?updateDir@QFactoryLoader@@QAEXABVQString@@AAVQSettings@@@Z @ 4884 NONAME ; void QFactoryLoader::updateDir(class QString const &, class QSettings &) ?disconnectNotify@QFutureWatcherBase@@MAEXPBD@Z @ 4885 NONAME ; void QFutureWatcherBase::disconnectNotify(char const *) ?maybeQueueForLater@QActiveObject@@QAE_NXZ @ 4886 NONAME ; bool QActiveObject::maybeQueueForLater(void) + ?activeObjectError@QEventDispatcherSymbian@@QAEXH@Z @ 4887 NONAME ; void QEventDispatcherSymbian::activeObjectError(int) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 6f903fd..4e0d7df 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -13990,4 +13990,11 @@ EXPORTS ?resetFontEngineCache@QTextEngine@@QAEXXZ @ 13989 NONAME ; void QTextEngine::resetFontEngineCache(void) ?symbianHandleLiteModeStartup@QApplicationPrivate@@QAEXXZ @ 13990 NONAME ; void QApplicationPrivate::symbianHandleLiteModeStartup(void) ?_q_cleanupWinIds@QWidgetPrivate@@QAEXXZ @ 13991 NONAME ; void QWidgetPrivate::_q_cleanupWinIds(void) - ?qt_s60_setEditorFlags@@YAXH@Z @ 13992 NONAME ; void qt_s60_setEditorFlags(int) + ?qt_s60_setEditorFlags@@YAXH@Z @ 13992 NONAME ; void qt_s60_setEditorFlags(int) + ?adjustViewOptionsForIndex@QTreeViewPrivate@@UBEXPAVQStyleOptionViewItemV4@@ABVQModelIndex@@@Z @ 13993 NONAME ; void QTreeViewPrivate::adjustViewOptionsForIndex(class QStyleOptionViewItemV4 *, class QModelIndex const &) const + ?setNativePaintMode@QSymbianGraphicsSystemHelper@@SAXPAVQWidget@@W4NativePaintMode@1@@Z @ 13994 NONAME ; void QSymbianGraphicsSystemHelper::setNativePaintMode(class QWidget *, enum QSymbianGraphicsSystemHelper::NativePaintMode) + ?calcLogicalIndices@QTreeViewPrivate@@QBEXPAV?$QVector@H@@PAV?$QVector@W4ViewItemPosition@QStyleOptionViewItemV4@@@@@Z @ 13995 NONAME ; void QTreeViewPrivate::calcLogicalIndices(class QVector *, class QVector *) const + ?setReceiveNativePaintEvents@QSymbianGraphicsSystemHelper@@SAXPAVQWidget@@_N@Z @ 13996 NONAME ; void QSymbianGraphicsSystemHelper::setReceiveNativePaintEvents(class QWidget *, bool) + ?setNativePaintMode@QSymbianGraphicsSystemHelper@@SAXPAVCCoeControl@@W4NativePaintMode@1@@Z @ 13997 NONAME ; void QSymbianGraphicsSystemHelper::setNativePaintMode(class CCoeControl *, enum QSymbianGraphicsSystemHelper::NativePaintMode) + ?setIgnoreFocusChanged@QSymbianGraphicsSystemHelper@@SAXPAVQWidget@@_N@Z @ 13998 NONAME ; void QSymbianGraphicsSystemHelper::setIgnoreFocusChanged(class QWidget *, bool) + diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index 2f8a7de..e03c024 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -1258,4 +1258,6 @@ EXPORTS ?metaObject@QHttpMultiPart@@UBEPBUQMetaObject@@XZ @ 1257 NONAME ; struct QMetaObject const * QHttpMultiPart::metaObject(void) const ?qt_static_metacall@QNetworkSession@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 1258 NONAME ; void QNetworkSession::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?startPolling@QNetworkConfigurationManagerPrivate@@AAEXXZ @ 1259 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void) + ?testSslOption@QSslConfiguration@@QBE_NW4SslOption@QSsl@@@Z @ 1260 NONAME ; bool QSslConfiguration::testSslOption(enum QSsl::SslOption) const + ?setSslOption@QSslConfiguration@@QAEXW4SslOption@QSsl@@_N@Z @ 1261 NONAME ; void QSslConfiguration::setSslOption(enum QSsl::SslOption, bool) diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def index 664e981..ed73a33 100644 --- a/src/s60installs/bwins/QtOpenGLu.def +++ b/src/s60installs/bwins/QtOpenGLu.def @@ -878,4 +878,6 @@ EXPORTS ?glGetShaderPrecisionFormat@QGLFunctions@@QAEXIIPAH0@Z @ 877 NONAME ; void QGLFunctions::glGetShaderPrecisionFormat(unsigned int, unsigned int, int *, int *) ?qt_static_metacall@QGLShaderProgram@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 878 NONAME ; void QGLShaderProgram::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *) ?insert@QGLContextGroupResourceBase@@QAEXPBVQGLContext@@PAX@Z @ 879 NONAME ; void QGLContextGroupResourceBase::insert(class QGLContext const *, void *) + ?contextDeleted@QGLContextGroupResourceBase@@UAEXPBVQGLContext@@@Z @ 880 NONAME ; void QGLContextGroupResourceBase::contextDeleted(class QGLContext const *) + ?contextDeleted@QGLTextureGlyphCache@@UAEXPBVQGLContext@@@Z @ 881 NONAME ; void QGLTextureGlyphCache::contextDeleted(class QGLContext const *) diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index 5436390..d80aecb 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -4165,4 +4165,5 @@ EXPORTS _ZN14QFactoryLoader9updateDirERK7QStringR9QSettings @ 4164 NONAME _ZN23QCoreApplicationPrivate26rebuildInstallLibraryPathsEv @ 4165 NONAME _ZN13QActiveObject18maybeQueueForLaterEv @ 4166 NONAME + _ZN23QEventDispatcherSymbian17activeObjectErrorEi @ 4167 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 07f0929..8aaa65d 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12804,3 +12804,10 @@ EXPORTS _ZN14QWidgetPrivate16_q_cleanupWinIdsEv @ 12803 NONAME _ZN19QApplicationPrivate28symbianHandleLiteModeStartupEv @ 12804 NONAME _Z21qt_s60_setEditorFlagsi @ 12805 NONAME + _ZN28QSymbianGraphicsSystemHelper18setNativePaintModeEP11CCoeControlNS_15NativePaintModeE @ 12806 NONAME + _ZN28QSymbianGraphicsSystemHelper18setNativePaintModeEP7QWidgetNS_15NativePaintModeE @ 12807 NONAME + _ZN28QSymbianGraphicsSystemHelper21setIgnoreFocusChangedEP7QWidgetb @ 12808 NONAME + _ZN28QSymbianGraphicsSystemHelper27setReceiveNativePaintEventsEP7QWidgetb @ 12809 NONAME + _ZNK16QTreeViewPrivate18calcLogicalIndicesEP7QVectorIiEPS0_IN22QStyleOptionViewItemV416ViewItemPositionEE @ 12810 NONAME + _ZNK16QTreeViewPrivate25adjustViewOptionsForIndexEP22QStyleOptionViewItemV4RK11QModelIndex @ 12811 NONAME + diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def index 6e7dedd..54f5b5f 100644 --- a/src/s60installs/eabi/QtNetworku.def +++ b/src/s60installs/eabi/QtNetworku.def @@ -1270,4 +1270,6 @@ EXPORTS _ZNK9QHttpParteqERKS_ @ 1269 NONAME _ZTI14QHttpMultiPart @ 1270 NONAME _ZTV14QHttpMultiPart @ 1271 NONAME + _ZN17QSslConfiguration12setSslOptionEN4QSsl9SslOptionEb @ 1272 NONAME + _ZNK17QSslConfiguration13testSslOptionEN4QSsl9SslOptionE @ 1273 NONAME diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def index 2d9aa8f..edb5e03 100644 --- a/src/s60installs/eabi/QtOpenGLu.def +++ b/src/s60installs/eabi/QtOpenGLu.def @@ -782,4 +782,5 @@ EXPORTS _ZThn104_N20QGLTextureGlyphCacheD0Ev @ 781 NONAME _ZThn104_N20QGLTextureGlyphCacheD1Ev @ 782 NONAME _ZThn8_NK16QGLWindowSurface8featuresEv @ 783 NONAME + _ZN27QGLContextGroupResourceBase14contextDeletedEPK10QGLContext @ 784 NONAME -- cgit v0.12 From 916076bfec520210966f67ae211af65b21a29dac Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 24 Nov 2011 11:40:52 +0000 Subject: Symbian - prefer sessions started by this process to choose proxy When WLAN and 3G connections are both active, the proxy for the wrong connection may have been chosen in the case of plain sockets or QNetworkAccessManager with an invalid configuration. When enumarating active connections to choose a proxy, prefer a connection that was opened by this process. Task-number: QTBUG-22615 Task-number: ou1cimx1#930701 Reviewed-by: mread --- src/corelib/kernel/qcore_symbian_p.cpp | 32 ++++++++++++ src/corelib/kernel/qcore_symbian_p.h | 22 +++++++++ src/network/kernel/qnetworkproxy_symbian.cpp | 27 ++++++++++ .../bearer/symbian/qnetworksession_impl.cpp | 57 +++++++++++++++++----- src/plugins/bearer/symbian/qnetworksession_impl.h | 3 ++ src/s60installs/bwins/QtCoreu.def | 5 +- src/s60installs/eabi/QtCoreu.def | 5 +- 7 files changed, 137 insertions(+), 14 deletions(-) diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp index 4f953a7..65ec3fe 100644 --- a/src/corelib/kernel/qcore_symbian_p.cpp +++ b/src/corelib/kernel/qcore_symbian_p.cpp @@ -246,6 +246,38 @@ RConnection* QSymbianSocketManager::defaultConnection() const return iDefaultConnection; } +void QSymbianSocketManager::addActiveConnection(TUint32 identifier) +{ + QMutexLocker l(&iMutex); + activeConnectionsMap[identifier]++; +#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG + qDebug() << "addActiveConnection" << identifier << activeConnectionsMap[identifier]; +#endif +} + +void QSymbianSocketManager::removeActiveConnection(TUint32 identifier) +{ + QMutexLocker l(&iMutex); + int& val(activeConnectionsMap[identifier]); + Q_ASSERT(val > 0); +#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG + qDebug() << "removeActiveConnection" << identifier << val - 1; +#endif + if (val <= 1) + activeConnectionsMap.remove(identifier); + else + val--; +} + +QList QSymbianSocketManager::activeConnections() const +{ + QMutexLocker l(&iMutex); +#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG + qDebug() << "activeConnections" << activeConnectionsMap.keys(); +#endif + return activeConnectionsMap.keys(); +} + Q_GLOBAL_STATIC(QSymbianSocketManager, qt_symbianSocketManager); QSymbianSocketManager& QSymbianSocketManager::instance() diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index a8f576d..6176ab5 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -247,6 +247,27 @@ public: /*! \internal + Add an opened connection to the active list + \param an open connection + */ + void addActiveConnection(TUint32 identifier); + + /*! + \internal + Remove a connection from the active list + \param a closed connection + */ + void removeActiveConnection(TUint32 identifier); + + /*! + \internal + Add an opened connection to the active list + \param an open connection + */ + QList activeConnections() const; + + /*! + \internal Gets a reference to the singleton socket manager */ static QSymbianSocketManager& instance(); @@ -258,6 +279,7 @@ private: int iNextSocket; QHash socketMap; QHash reverseSocketMap; + QHash activeConnectionsMap; mutable QMutex iMutex; RSocketServ iSocketServ; RConnection *iDefaultConnection; diff --git a/src/network/kernel/qnetworkproxy_symbian.cpp b/src/network/kernel/qnetworkproxy_symbian.cpp index 73068d6..e96c372 100644 --- a/src/network/kernel/qnetworkproxy_symbian.cpp +++ b/src/network/kernel/qnetworkproxy_symbian.cpp @@ -60,6 +60,7 @@ #include #include #include +#include using namespace CommsDat; @@ -73,6 +74,25 @@ public: void setIapId(TUint32 iapId) { valid = true; id = iapId; } bool isValid() { return valid; } TUint32 iapId() { return id; } + static SymbianIapId fromConfiguration(const QNetworkConfiguration& config) + { + SymbianIapId iapId; + // Note: the following code assumes that the identifier is in format + // I_xxxx where xxxx is the identifier of IAP. This is meant as a + // temporary solution until there is a support for returning + // implementation specific identifier. + const int generalPartLength = 2; + QString idString(config.identifier().mid(generalPartLength)); + bool success; + uint id = idString.toUInt(&success); + if (success) + iapId.setIapId(id); + else + qWarning() << "Failed to convert identifier to access point identifier: " + << config.identifier(); + return iapId; + } + private: bool valid; TUint32 id; @@ -122,9 +142,16 @@ QNetworkConfiguration SymbianProxyQuery::findCurrentConfigurationFromServiceNetw QNetworkConfiguration SymbianProxyQuery::findCurrentConfiguration(QNetworkConfigurationManager& configurationManager) { + QList openConfigurations = QSymbianSocketManager::instance().activeConnections(); QList activeConfigurations = configurationManager.allConfigurations( QNetworkConfiguration::Active); + for (int i = 0; i < activeConfigurations.count(); i++) { + // get first configuration which was opened by this process + if (openConfigurations.contains(SymbianIapId::fromConfiguration(activeConfigurations.at(i)).iapId())) + return activeConfigurations.at(i); + } if (activeConfigurations.count() > 0) { + // get first active configuration opened by any process return activeConfigurations.at(0); } else { // No active configurations, try default one diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index f5f71cf..58ce8fe 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -64,7 +64,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine) ipConnectionNotifier(0), ipConnectionStarter(0), iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iError(QNetworkSession::UnknownSessionError), iALREnabled(0), - iConnectInBackground(false), isOpening(false) + iConnectInBackground(false), iCurrentIap(0), isOpening(false) { #ifdef SNAP_FUNCTIONALITY_AVAILABLE @@ -77,6 +77,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine) void QNetworkSessionPrivateImpl::closeHandles() { QMutexLocker lock(&mutex); + updateCurrentIap(0); // Cancel Connection Progress Notifications first. // Note: ConnectionNotifier must be destroyed before RConnection::Close() // => deleting ipConnectionNotifier results RConnection::CancelProgressNotification() @@ -637,6 +638,8 @@ void QNetworkSessionPrivateImpl::accept() QSymbianSocketManager::instance().setDefaultConnection(&iConnection); + updateCurrentIap(iNewRoamingIap); + newState(QNetworkSession::Connected, iNewRoamingIap); } #endif @@ -867,19 +870,31 @@ quint64 QNetworkSessionPrivateImpl::activeTime() const return startTime.secsTo(QDateTime::currentDateTime()); } -QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 iapId) const +bool QNetworkSessionPrivateImpl::activeIapId(TUint32& iapId) const { - if (iapId == 0) { - _LIT(KSetting, "IAP\\Id"); - iConnection.GetIntSetting(KSetting, iapId); + if (!iConnection.SubSessionHandle()) + return false; + _LIT(KSetting, "IAP\\Id"); + TInt err = iConnection.GetIntSetting(KSetting, iapId); + if (err != KErrNone) + return false; #ifdef SNAP_FUNCTIONALITY_AVAILABLE - // Check if this is an Easy WLAN configuration. On Symbian^3 RConnection may report - // the used configuration as 'EasyWLAN' IAP ID if someone has just opened the configuration - // from WLAN Scan dialog, _and_ that connection is still up. We need to find the - // real matching configuration. Function alters the Easy WLAN ID to real IAP ID (only if - // easy WLAN): - easyWlanTrueIapId(iapId); + // Check if this is an Easy WLAN configuration. On Symbian^3 RConnection may report + // the used configuration as 'EasyWLAN' IAP ID if someone has just opened the configuration + // from WLAN Scan dialog, _and_ that connection is still up. We need to find the + // real matching configuration. Function alters the Easy WLAN ID to real IAP ID (only if + // easy WLAN): + easyWlanTrueIapId(iapId); #endif + return true; +} + +QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 iapId) const +{ + if (iapId == 0) { + bool ok = activeIapId(iapId); + if (!ok) + return QNetworkConfiguration(); } #ifdef SNAP_FUNCTIONALITY_AVAILABLE @@ -1015,6 +1030,20 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia return publicConfig; } +void QNetworkSessionPrivateImpl::updateCurrentIap(TUint32 iapId) +{ + if (iCurrentIap == iapId) + return; + + if (iCurrentIap != 0) + QSymbianSocketManager::instance().removeActiveConnection(iCurrentIap); + + iCurrentIap = iapId; + + if (iCurrentIap != 0) + QSymbianSocketManager::instance().addActiveConnection(iCurrentIap); +} + void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) { #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG @@ -1028,7 +1057,10 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) case KErrNone: // Connection created successfully { TInt error = KErrNone; - QNetworkConfiguration newActiveConfig = activeConfiguration(); + TUint32 iapId; + QNetworkConfiguration newActiveConfig; + if (activeIapId(iapId)) + newActiveConfig = activeConfiguration(iapId); if (!newActiveConfig.isValid()) { // RConnection startup was successful but no configuration // was found. That indicates that user has chosen to create a @@ -1038,6 +1070,7 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) error = KErrGeneral; } else { QSymbianSocketManager::instance().setDefaultConnection(&iConnection); + updateCurrentIap(iapId); } if (error != KErrNone) { isOpen = false; diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index 17a051e..9e02e5b 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -143,6 +143,8 @@ private: void handleSymbianConnectionStatusChange(TInt aConnectionStatus, TInt aError, TUint accessPointId = 0); QNetworkConfiguration bestConfigFromSNAP(const QNetworkConfiguration& snapConfig) const; QNetworkConfiguration activeConfiguration(TUint32 iapId = 0) const; + bool activeIapId(TUint32 &iapId) const; + void updateCurrentIap(TUint32 iapId); #ifndef QT_NO_NETWORKINTERFACE QNetworkInterface interface(TUint iapId) const; #endif @@ -186,6 +188,7 @@ private: // data TUint32 iOldRoamingIap; TUint32 iNewRoamingIap; + TUint32 iCurrentIap; bool isOpening; diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index 08c67e0..cfd2cec 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4885,5 +4885,8 @@ EXPORTS ?updateDir@QFactoryLoader@@QAEXABVQString@@AAVQSettings@@@Z @ 4884 NONAME ; void QFactoryLoader::updateDir(class QString const &, class QSettings &) ?disconnectNotify@QFutureWatcherBase@@MAEXPBD@Z @ 4885 NONAME ; void QFutureWatcherBase::disconnectNotify(char const *) ?maybeQueueForLater@QActiveObject@@QAE_NXZ @ 4886 NONAME ; bool QActiveObject::maybeQueueForLater(void) - ?activeObjectError@QEventDispatcherSymbian@@QAEXH@Z @ 4887 NONAME ; void QEventDispatcherSymbian::activeObjectError(int) + ?activeConnections@QSymbianSocketManager@@QBE?AV?$QList@K@@XZ @ 4887 NONAME ; class QList QSymbianSocketManager::activeConnections(void) const + ?removeActiveConnection@QSymbianSocketManager@@QAEXK@Z @ 4888 NONAME ; void QSymbianSocketManager::removeActiveConnection(unsigned long) + ?addActiveConnection@QSymbianSocketManager@@QAEXK@Z @ 4889 NONAME ; void QSymbianSocketManager::addActiveConnection(unsigned long) + ?activeObjectError@QEventDispatcherSymbian@@QAEXH@Z @ 4890 NONAME ; void QEventDispatcherSymbian::activeObjectError(int) diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index d80aecb..44aa48c 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -4165,5 +4165,8 @@ EXPORTS _ZN14QFactoryLoader9updateDirERK7QStringR9QSettings @ 4164 NONAME _ZN23QCoreApplicationPrivate26rebuildInstallLibraryPathsEv @ 4165 NONAME _ZN13QActiveObject18maybeQueueForLaterEv @ 4166 NONAME - _ZN23QEventDispatcherSymbian17activeObjectErrorEi @ 4167 NONAME + _ZN21QSymbianSocketManager19addActiveConnectionEm @ 4167 NONAME + _ZN21QSymbianSocketManager22removeActiveConnectionEm @ 4168 NONAME + _ZN23QEventDispatcherSymbian17activeObjectErrorEi @ 4169 NONAME + _ZNK21QSymbianSocketManager17activeConnectionsEv @ 4170 NONAME -- cgit v0.12 From 8a76e0e327ba6330e1520fdd898a7dcf57a9bf2a Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 24 Nov 2011 16:49:23 +0000 Subject: doc - document symbian behaviour of QFile::link Task-number: ou1cimx1#943243 Reviewed-by: mread --- src/corelib/io/qfile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index cdee7ce..09d0c58 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -824,8 +824,7 @@ QFile::rename(const QString &oldName, const QString &newName) \note To create a valid link on Windows, \a linkName must have a \c{.lnk} file extension. - \note On Symbian, no link is created and false is returned if fileName() - currently specifies a directory. + \note Symbian filesystem does not support links. \sa setFileName() */ -- cgit v0.12 From d2a3b9ee8c9329cac96b5e509df0e6a69dbef91c Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 1 Dec 2011 09:42:00 +0200 Subject: Fix def files Reviewed-by: TRUSTME --- src/s60installs/bwins/QtOpenVGu.def | 2 +- src/s60installs/eabi/QtOpenVGu.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index 547931e..dc1ddce 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -159,7 +159,7 @@ EXPORTS ?hibernate@QVGImagePool@@UAEXXZ @ 158 NONAME ; void QVGImagePool::hibernate(void) ?qt_vg_destroy_context@@YAXPAVQEglContext@@H@Z @ 159 NONAME ; void qt_vg_destroy_context(class QEglContext *, int) ??0QVGImagePool@@QAE@XZ @ 160 NONAME ; QVGImagePool::QVGImagePool(void) - ?setImagePool@QVGImagePool@@SAXPAV1@@Z @ 161 NONAME ; void QVGImagePool::setImagePool(class QVGImagePool *) + ?setImagePool@QVGImagePool@@SAXPAV1@@Z @ 161 NONAME ABSENT ; void QVGImagePool::setImagePool(class QVGImagePool *) ?pixmapLRU@QVGImagePool@@IAEPAVQVGPixmapData@@XZ @ 162 NONAME ; class QVGPixmapData * QVGImagePool::pixmapLRU(void) ?qt_vg_create_context@@YAPAVQEglContext@@PAVQPaintDevice@@H@Z @ 163 NONAME ; class QEglContext * qt_vg_create_context(class QPaintDevice *, int) ?reclaimImages@QVGPixmapData@@UAEXXZ @ 164 NONAME ; void QVGPixmapData::reclaimImages(void) diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def index a66df98..f87c71d 100644 --- a/src/s60installs/eabi/QtOpenVGu.def +++ b/src/s60installs/eabi/QtOpenVGu.def @@ -176,7 +176,7 @@ EXPORTS _ZN12QVGImagePool11detachImageEP13QVGPixmapData @ 175 NONAME _ZN12QVGImagePool12reclaimSpaceE13VGImageFormatllP13QVGPixmapData @ 176 NONAME _ZN12QVGImagePool12releaseImageEP13QVGPixmapDatam @ 177 NONAME - _ZN12QVGImagePool12setImagePoolEPS_ @ 178 NONAME + _ZN12QVGImagePool12setImagePoolEPS_ @ 178 NONAME ABSENT _ZN12QVGImagePool13removeFromLRUEP13QVGPixmapData @ 179 NONAME _ZN12QVGImagePool15moveToHeadOfLRUEP13QVGPixmapData @ 180 NONAME _ZN12QVGImagePool20createImageForPixmapE13VGImageFormatllmP13QVGPixmapData @ 181 NONAME -- cgit v0.12 From 1affc6720a338f59b824af1825936335e7ce1602 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 1 Dec 2011 15:01:01 +0200 Subject: Symbian: Fix CBA display on application with multiple windows If an application has more than one window and each window has widgets that can receive focus, sometimes a situation happened when the last focused window isn't actually the window that contains the current focused widget, which led to displaying incorrect CBA. Changed CBA displaying evaluation to be done whenever any control is focused instead of just windows. This can add a couple of extra S60->setRecursiveDecorationsVisibility() calls to some applications, but since that is typically already called multiple times anyway, it shouldn't be an issue. Task-number: ou1cimx1#935663 Reviewed-by: Sami Merila --- src/gui/kernel/qapplication_s60.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index ca9c3a3..c94d66d 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1548,6 +1548,7 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) || (qwidget->windowType() & Qt::Popup) == Qt::Popup) return; + QWidget *parentWindow = qwidget->window(); if (IsFocused() && IsVisible()) { if (m_symbianPopupIsOpen) { QWidget *fw = QApplication::focusWidget(); @@ -1562,11 +1563,10 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowIcon_sys(true); qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 - if (qwidget->isWindow()) - S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState()); + if (parentWindow->isWindow()) + S60->setRecursiveDecorationsVisibility(parentWindow, parentWindow->windowState()); #endif } else { - QWidget *parentWindow = qwidget->window(); if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) { if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) { QWidget *fw = QApplication::focusWidget(); -- cgit v0.12 From 1c9d051399c683bf89dfd1bca54bc3c48d534087 Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 2 Dec 2011 11:44:56 +0000 Subject: Correct client rect calculation for MCL The clientRect calculation was adjusting the rectangle for the status pane. But this is now taken into account in the rectangle from Avkon, so we do not need to adjust when the status pane is there. However Avkon is supplying an inconsistent clientRect depending on whether we have all Avkon panes disabled (status pane and CBAs). When enabled, Avkon takes the splitview keyboard off the clientRect space, when disabled, Avkon ignores the splitview keyboard. Since we want to ignore the splitview keyboard effect on the clientRect, we only adjust when the Avkon panes are enabled. This has been tested with splitview keyboard, orientation change and debug output of the client rectangle returned in the following situations: - Normal app with status pane and CBA - App with CBA but invisible status pane - App with status pane and CBA disabled Task-number: ou1cimx1#938780 Reviewed-by: Miikka Heikkinen --- src/gui/kernel/qapplication_s60.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index c94d66d..587c0f2 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -273,19 +273,16 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) TRect QS60Data::clientRect() { TRect r = static_cast(S60->appUi())->ClientRect(); - if (S60->partialKeyboardOpen) { - // Adjust client rect when splitview is open, since for some curious reason - // native side insists that clientRect starts from (0,0) even though status - // pane might be visible. + if (S60->partialKeyboardOpen && !QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) { + // Adjust client rect when splitview is open + // We want it to take the client rect space as if the splitview keyboard was not there TRect statusPaneRect; TRect mainRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect); AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainRect); int clientAreaHeight = mainRect.Height(); CEikStatusPane *const s = S60->statusPane(); - if (s && s->IsVisible()) - r.Move(0, statusPaneRect.Height()); - else + if (!(s && s->IsVisible())) clientAreaHeight += statusPaneRect.Height(); r.SetHeight(clientAreaHeight); } -- cgit v0.12