summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-27 12:17:28 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-28 08:21:46 (GMT)
commit0b61f3e8b7656b3295c959ea8e54c3321167c7fa (patch)
tree92f131ce447f75896f43d3a560a7274e46fbf92a /src/corelib/kernel/qcoreapplication.cpp
parent89dfa8d7a46c992b066e5335d64089bf796e2f83 (diff)
downloadQt-0b61f3e8b7656b3295c959ea8e54c3321167c7fa.zip
Qt-0b61f3e8b7656b3295c959ea8e54c3321167c7fa.tar.gz
Qt-0b61f3e8b7656b3295c959ea8e54c3321167c7fa.tar.bz2
Avoid sending deprecated Qt3Support events if the application was built without Qt3Support
- Detect if the application was built using Qt3Support using the QApplication's constructor internal flags. - Move that from QApplication to QCoreApplication. - Do not send the event if the application was not built with Qt3Support Reviewed-by: Brad
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index a354498..179158f 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -122,6 +122,11 @@ static SystemDriveFunc PtrGetSystemDrive=0;
extern QString qAppFileName();
#endif
+int QCoreApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0
+#if defined(QT3_SUPPORT)
+bool QCoreApplicationPrivate::useQt3Support = true;
+#endif
+
#if !defined(Q_OS_WIN)
#ifdef Q_OS_MAC
QString QCoreApplicationPrivate::macMenuBarName()
@@ -263,10 +268,14 @@ struct QCoreApplicationData {
Q_GLOBAL_STATIC(QCoreApplicationData, coreappdata)
-QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv)
+QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint flags)
: QObjectPrivate(), argc(aargc), argv(aargv), application_type(0), eventFilter(0),
in_exec(false), aboutToQuitEmitted(false)
{
+ app_compile_version = flags & 0xffffff;
+#if defined(QT3_SUPPORT)
+ useQt3Support = !(flags & 0x01000000);
+#endif
static const char *const empty = "";
if (argc == 0 || argv == 0) {
argc = 0;
@@ -511,7 +520,7 @@ void QCoreApplication::flush()
one valid character string.
*/
QCoreApplication::QCoreApplication(int &argc, char **argv)
- : QObject(*new QCoreApplicationPrivate(argc, argv))
+ : QObject(*new QCoreApplicationPrivate(argc, argv, 0x040000))
{
init();
QCoreApplicationPrivate::eventDispatcher->startingUp();
@@ -527,6 +536,25 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
#endif
}
+QCoreApplication::QCoreApplication(int &argc, char **argv, int _internal)
+: QObject(*new QCoreApplicationPrivate(argc, argv, _internal))
+{
+ init();
+ QCoreApplicationPrivate::eventDispatcher->startingUp();
+#if defined(Q_OS_SYMBIAN)
+#ifndef QT_NO_LIBRARY
+ // Refresh factoryloader, as text codecs are requested during lib path
+ // resolving process and won't be therefore properly loaded.
+ // Unknown if this is symbian specific issue.
+ QFactoryLoader::refreshAll();
+#endif
+#ifndef QT_NO_SYSTEMLOCALE
+ d_func()->symbianInit();
+#endif
+#endif //Q_OS_SYMBIAN
+}
+
+
// ### move to QCoreApplicationPrivate constructor?
void QCoreApplication::init()
{
@@ -1014,6 +1042,7 @@ int QCoreApplication::exec()
return returnCode;
}
+
/*!
Tells the application to exit with a return code.