diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-12-05 06:06:46 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-12-05 06:06:46 (GMT) |
commit | a1640ce50e9350df64fca984a3454a72e31f0ef7 (patch) | |
tree | 80c369d115452d794480734bde2150934bf07602 | |
parent | 91814c0a9d32b5a306037a73c067c02d3f5be4ff (diff) | |
parent | 235e4fb7316cfe65605c3a035cf3a4f0d167335c (diff) | |
download | Qt-a1640ce50e9350df64fca984a3454a72e31f0ef7.zip Qt-a1640ce50e9350df64fca984a3454a72e31f0ef7.tar.gz Qt-a1640ce50e9350df64fca984a3454a72e31f0ef7.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging:
Correct client rect calculation for MCL
Symbian: Fix CBA display on application with multiple windows
Fix def files
doc - document symbian behaviour of QFile::link
Symbian - prefer sessions started by this process to choose proxy
Freezing Def files in Qt
Lightmaps demo Symbian fix
CBA comes on top of option menu
Fix memory leaks in OpenVG and OpenGL resource pools
Fix sqlite driver memory eating due to close failure
24 files changed, 237 insertions, 49 deletions
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 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() */ 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<TUint32> 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<TUint32> activeConnections() const; + + /*! + \internal Gets a reference to the singleton socket manager */ static QSymbianSocketManager& instance(); @@ -258,6 +279,7 @@ private: int iNextSocket; QHash<QHashableSocket, int> socketMap; QHash<int, RSocket> reverseSocketMap; + QHash<TUint32, int> activeConnectionsMap; mutable QMutex iMutex; RSocketServ iSocketServ; RConnection *iDefaultConnection; diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index ca9c3a3..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<CEikAppUi*>(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); } @@ -1548,6 +1545,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 +1560,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(); 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); 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 <QtNetwork/QNetworkConfigurationManager> #include <QtNetwork/QNetworkConfiguration> #include <QFlags> +#include <QtCore/private/qcore_symbian_p.h> 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<TUint32> openConfigurations = QSymbianSocketManager::instance().activeConnections(); QList<QNetworkConfiguration> 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/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. 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 9181dd7..cfd2cec 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4885,4 +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) + ?activeConnections@QSymbianSocketManager@@QBE?AV?$QList@K@@XZ @ 4887 NONAME ; class QList<unsigned long> 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/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<int> *, class QVector<enum QStyleOptionViewItemV4::ViewItemPosition> *) 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/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/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index 5436390..44aa48c 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -4165,4 +4165,8 @@ EXPORTS _ZN14QFactoryLoader9updateDirERK7QStringR9QSettings @ 4164 NONAME _ZN23QCoreApplicationPrivate26rebuildInstallLibraryPathsEv @ 4165 NONAME _ZN13QActiveObject18maybeQueueForLaterEv @ 4166 NONAME + _ZN21QSymbianSocketManager19addActiveConnectionEm @ 4167 NONAME + _ZN21QSymbianSocketManager22removeActiveConnectionEm @ 4168 NONAME + _ZN23QEventDispatcherSymbian17activeObjectErrorEi @ 4169 NONAME + _ZNK21QSymbianSocketManager17activeConnectionsEv @ 4170 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 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 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 <QSQLiteResult *> 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<const QSQLiteDriver *>(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() { |