diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-03 10:23:56 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-03 10:23:56 +0200 |
commit | e2f66f921594b7be4af4a058c959557489e86879 (patch) | |
tree | cc44931708b57bd5a761906797c7dee0360d1d6b /src/corelib/kernel/qcoreapplication.cpp | |
parent | 933bf178aab88ab5df8a68cbf02611d6d8744b1b (diff) | |
parent | 754efa57d89c62d1796e01b407e9222e67450f52 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/corelib/global/qnamespace.qdoc
src/corelib/io/qwindowspipereader.cpp
src/corelib/io/qwindowspipereader_p.h
src/corelib/statemachine/qstatemachine.cpp
src/corelib/statemachine/qstatemachine_p.h
src/plugins/platforms/xcb/qxcbconnection.h
tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
tests/auto/tools/qmake/tst_qmake.cpp
tests/manual/touch/main.cpp
Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 05d58ac028..524bfd26cc 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -325,6 +325,7 @@ struct QCoreApplicationData { #ifndef QT_NO_LIBRARY app_libpaths = 0; #endif + applicationNameSet = false; } ~QCoreApplicationData() { #ifndef QT_NO_LIBRARY @@ -369,8 +370,8 @@ struct QCoreApplicationData { QString orgName, orgDomain; QString application; // application name, initially from argv[0], can then be modified. - QString applicationNameCompat; // for QDesktopServices. Only set explicitly. QString applicationVersion; + bool applicationNameSet; // true if setApplicationName was called #ifndef QT_NO_LIBRARY QStringList *app_libpaths; @@ -752,7 +753,8 @@ void QCoreApplication::init() QCoreApplication::self = this; // Store app name (so it's still available after QCoreApplication is destroyed) - coreappdata()->application = d_func()->appName(); + if (!coreappdata()->applicationNameSet) + coreappdata()->application = d_func()->appName(); QLoggingRegistry::instance()->init(); @@ -2349,13 +2351,13 @@ QString QCoreApplication::organizationDomain() */ void QCoreApplication::setApplicationName(const QString &application) { + coreappdata()->applicationNameSet = !application.isEmpty(); QString newAppName = application; if (newAppName.isEmpty() && QCoreApplication::self) newAppName = QCoreApplication::self->d_func()->appName(); if (coreappdata()->application == newAppName) return; coreappdata()->application = newAppName; - coreappdata()->applicationNameCompat = newAppName; #ifndef QT_NO_QOBJECT if (QCoreApplication::self) emit QCoreApplication::self->applicationNameChanged(); @@ -2373,7 +2375,7 @@ QString QCoreApplication::applicationName() // Exported for QDesktopServices (Qt4 behavior compatibility) Q_CORE_EXPORT QString qt_applicationName_noFallback() { - return coreappdata()->applicationNameCompat; + return coreappdata()->applicationNameSet ? coreappdata()->application : QString(); } /*! |