summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2011-05-02 11:56:03 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:53 +0200
commit42452a32bfea29bf8176d19442f6e3c890c2b7e2 (patch)
treeccf32bee3dba2a6bf3d40ec44667b9032e4bd0df /src
parentc0da3003df9e0a70121e10dc6fa9ae54cf13ecfe (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')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp21
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
3 files changed, 12 insertions, 13 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();
}
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 937a101085..5079e4681c 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -142,7 +142,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 6f3ee1c3d3..d9aac00cf1 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