Factor xcb check into a local variable

Change-Id: Ib57f73f7a733a94bed4522ddd2d19c4980d8d6b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
David Faure 2014-04-25 10:46:45 +02:00 committed by The Qt Project
parent 532b94e98f
commit 84f02a9e14

View File

@ -1098,6 +1098,7 @@ void QGuiApplicationPrivate::createPlatformIntegration()
argv[j++] = argv[i]; argv[j++] = argv[i];
continue; continue;
} }
const bool isXcb = platformName == "xcb";
QByteArray arg = argv[i]; QByteArray arg = argv[i];
if (arg.startsWith("--")) if (arg.startsWith("--"))
arg.remove(0, 1); arg.remove(0, 1);
@ -1110,13 +1111,13 @@ void QGuiApplicationPrivate::createPlatformIntegration()
} else if (arg == "-platformtheme") { } else if (arg == "-platformtheme") {
if (++i < argc) if (++i < argc)
platformThemeName = QString::fromLocal8Bit(argv[i]); platformThemeName = QString::fromLocal8Bit(argv[i]);
} else if (arg == "-qwindowgeometry" || (platformName == "xcb" && arg == "-geometry")) { } else if (arg == "-qwindowgeometry" || (isXcb && arg == "-geometry")) {
if (++i < argc) if (++i < argc)
windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]);
} else if (arg == "-qwindowtitle" || (platformName == "xcb" && arg == "-title")) { } else if (arg == "-qwindowtitle" || (isXcb && arg == "-title")) {
if (++i < argc) if (++i < argc)
firstWindowTitle = QString::fromLocal8Bit(argv[i]); firstWindowTitle = QString::fromLocal8Bit(argv[i]);
} else if (arg == "-qwindowicon" || (platformName == "xcb" && arg == "-icon")) { } else if (arg == "-qwindowicon" || (isXcb && arg == "-icon")) {
if (++i < argc) { if (++i < argc) {
const QString icon = QString::fromLocal8Bit(argv[i]); const QString icon = QString::fromLocal8Bit(argv[i]);
forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon); forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon);