Fix init order of platfromIntegration and forcedWindowIcon

The problem shows when running tst_qguiapplication.cpp and configuring
with -no-widgets

Change-Id: I9f241760953e543d488096c66a3e886a14f6ae50
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Frederik Gladhorn 2014-07-01 11:47:50 +02:00 committed by David Faure
parent e4becdc3d3
commit 605ba2c226

View File

@ -1102,6 +1102,8 @@ void QGuiApplicationPrivate::createPlatformIntegration()
// Get command line params
QString icon;
int j = argc ? 1 : 0;
for (int i=1; i<argc; i++) {
if (argv[i] && *argv[i] != '-') {
@ -1129,8 +1131,7 @@ void QGuiApplicationPrivate::createPlatformIntegration()
firstWindowTitle = QString::fromLocal8Bit(argv[i]);
} else if (arg == "-qwindowicon" || (isXcb && arg == "-icon")) {
if (++i < argc) {
const QString icon = QString::fromLocal8Bit(argv[i]);
forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon);
icon = QString::fromLocal8Bit(argv[i]);
}
} else {
argv[j++] = argv[i];
@ -1144,6 +1145,8 @@ void QGuiApplicationPrivate::createPlatformIntegration()
init_platform(QLatin1String(platformName), platformPluginPath, platformThemeName, argc, argv);
if (!icon.isEmpty())
forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon);
}
/*!