Handle "-psn_XXX" command line args on Mac
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Tue, 7 Aug 2012 12:17:27 +0000 (14:17 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 10 Aug 2012 09:42:22 +0000 (11:42 +0200)
Finder on Mac OS X sends a command line argument of
the form -psn_0_3523420 when launching applications.
Eat the argument like we do in Qt 4.

Change-Id: I09db9dea035e62c0b816a833c9ad6fcd78f83735
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Simo Fält <simo.falt@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/gui/kernel/qguiapplication.cpp

index af899cf..85297dd 100644 (file)
@@ -842,6 +842,10 @@ void QGuiApplicationPrivate::init()
         } else if (arg == "-reverse") {
             force_reverse = true;
             QGuiApplication::setLayoutDirection(Qt::RightToLeft);
+#ifdef Q_OS_MAC
+        } else if (arg.startsWith("-psn_")) {
+            // eat "-psn_xxxx" on Mac
+#endif
         } else {
             argv[j++] = argv[i];
         }