diff options
author | mae <qt-info@nokia.com> | 2011-05-02 11:56:03 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-10 12:54:53 +0200 |
commit | 42452a32bfea29bf8176d19442f6e3c890c2b7e2 (patch) | |
tree | ccf32bee3dba2a6bf3d40ec44667b9032e4bd0df /src/corelib/kernel/qcoreapplication.cpp | |
parent | c0da3003df9e0a70121e10dc6fa9ae54cf13ecfe (diff) |
Fix regression with QSettings patch
The plugin loader is used without QCoreApplication.
This fixes 31ef8fa6abc2ea23c6f0a996b36494d88aafb0b5
(cherry picked from commit 988871dabf3c949ffc71d126131281a3ae641ebf)
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 2eef70a480..afbcff3eb9 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() @@ -697,13 +703,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(); } |