diff options
author | mae <qt-info@nokia.com> | 2011-05-02 09:56:03 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2011-05-02 09:58:43 (GMT) |
commit | 988871dabf3c949ffc71d126131281a3ae641ebf (patch) | |
tree | ce144516ac0083ea559e51b755370c64dd64798f | |
parent | 31ef8fa6abc2ea23c6f0a996b36494d88aafb0b5 (diff) | |
download | Qt-988871dabf3c949ffc71d126131281a3ae641ebf.zip Qt-988871dabf3c949ffc71d126131281a3ae641ebf.tar.gz Qt-988871dabf3c949ffc71d126131281a3ae641ebf.tar.bz2 |
Fix regression with QSettings patch
The plugin loader is used without QCoreApplication.
This fixes 31ef8fa6abc2ea23c6f0a996b36494d88aafb0b5
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 21 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_p.h | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 2 |
3 files changed, 12 insertions, 13 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index df8bc59..e569894 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -270,7 +270,16 @@ bool QCoreApplicationPrivate::is_app_closing = false; Q_CORE_EXPORT bool qt_locale_initialized = false; -QSettings *QCoreApplicationPrivate::trolltechConf = 0; +/* + Create an instance of Trolltech.conf. This ensures that the settings will not + be thrown out of QSetting's cache for unused settings. + */ +Q_GLOBAL_STATIC_WITH_ARGS(QSettings, trolltechConf, (QSettings::UserScope, QLatin1String("Trolltech"))) + +QSettings *QCoreApplicationPrivate::trolltechConf() +{ + return ::trolltechConf(); +} Q_CORE_EXPORT uint qGlobalPostedEventsCount() { @@ -373,9 +382,6 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate() threadData->postEventList.recursion = 0; threadData->quitNow = false; } - - delete trolltechConf; - trolltechConf = 0; } void QCoreApplicationPrivate::createEventDispatcher() @@ -693,13 +699,6 @@ void QCoreApplication::init() } #endif - - /* - Create an instance of Trolltech.conf. This ensures that the settings will not - be thrown out of QSetting's cache for unused settings. - */ - d->trolltechConf = new QSettings(QSettings::UserScope, QLatin1String("Trolltech")); - qt_startup_hook(); } diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 0557f83..eb46ae5 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -140,7 +140,7 @@ public: #if defined(QT3_SUPPORT) static bool useQt3Support; #endif - static QSettings *trolltechConf; + static QSettings *trolltechConf(); }; QT_END_NAMESPACE diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 6f3ee1c..d9aac00 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -706,7 +706,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) QStringList reg; #ifndef QT_NO_SETTINGS if (!settings) { - settings = QCoreApplicationPrivate::trolltechConf; + settings = QCoreApplicationPrivate::trolltechConf(); } reg = settings->value(regkey).toStringList(); #endif |