From 84f02a9e144095bb5ecb89e7accada83ff415523 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 25 Apr 2014 10:46:45 +0200 Subject: [PATCH] Factor xcb check into a local variable Change-Id: Ib57f73f7a733a94bed4522ddd2d19c4980d8d6b6 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 01b888919d..a49f0ce496 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1098,6 +1098,7 @@ void QGuiApplicationPrivate::createPlatformIntegration() argv[j++] = argv[i]; continue; } + const bool isXcb = platformName == "xcb"; QByteArray arg = argv[i]; if (arg.startsWith("--")) arg.remove(0, 1); @@ -1110,13 +1111,13 @@ void QGuiApplicationPrivate::createPlatformIntegration() } else if (arg == "-platformtheme") { if (++i < argc) platformThemeName = QString::fromLocal8Bit(argv[i]); - } else if (arg == "-qwindowgeometry" || (platformName == "xcb" && arg == "-geometry")) { + } else if (arg == "-qwindowgeometry" || (isXcb && arg == "-geometry")) { if (++i < argc) windowGeometrySpecification = QWindowGeometrySpecification::fromArgument(argv[i]); - } else if (arg == "-qwindowtitle" || (platformName == "xcb" && arg == "-title")) { + } else if (arg == "-qwindowtitle" || (isXcb && arg == "-title")) { if (++i < argc) firstWindowTitle = QString::fromLocal8Bit(argv[i]); - } else if (arg == "-qwindowicon" || (platformName == "xcb" && arg == "-icon")) { + } 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);