summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp12
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index be86c58..df8bc59 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -270,6 +270,8 @@ bool QCoreApplicationPrivate::is_app_closing = false;
Q_CORE_EXPORT bool qt_locale_initialized = false;
+QSettings *QCoreApplicationPrivate::trolltechConf = 0;
+
Q_CORE_EXPORT uint qGlobalPostedEventsCount()
{
QThreadData *currentThreadData = QThreadData::current();
@@ -371,6 +373,9 @@ QCoreApplicationPrivate::~QCoreApplicationPrivate()
threadData->postEventList.recursion = 0;
threadData->quitNow = false;
}
+
+ delete trolltechConf;
+ trolltechConf = 0;
}
void QCoreApplicationPrivate::createEventDispatcher()
@@ -688,6 +693,13 @@ 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 add2a35..0557f83 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -55,6 +55,7 @@
#include "QtCore/qcoreapplication.h"
#include "QtCore/qtranslator.h"
+#include "QtCore/qsettings.h"
#include "private/qobject_p.h"
#ifdef Q_OS_SYMBIAN
@@ -139,6 +140,7 @@ public:
#if defined(QT3_SUPPORT)
static bool useQt3Support;
#endif
+ static QSettings *trolltechConf;
};
QT_END_NAMESPACE