Skip to content

Commit

Permalink
Factor xcb check into a local variable
Browse files Browse the repository at this point in the history
Change-Id: Ib57f73f7a733a94bed4522ddd2d19c4980d8d6b6
Reviewed-by: Friedemann Kleint <[email protected]>
  • Loading branch information
dfaure-kdab authored and The Qt Project committed May 2, 2014
1 parent 532b94e commit 84f02a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/kernel/qguiapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 84f02a9

Please sign in to comment.