QGuiApplication: properly decode path command-line arguments

Using QFile::decodeName, not QString::fromLocal8Bit.

Pick-to: 6.2
Change-Id: Ice04365c72984d07a64dfffd16b47dcbfee23341
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Thiago Macieira 2021-11-04 17:07:59 -07:00
parent 893990a67e
commit b0dc6abfb2

View File

@ -1445,7 +1445,7 @@ void QGuiApplicationPrivate::createPlatformIntegration()
++arg;
if (strcmp(arg, "-platformpluginpath") == 0) {
if (++i < argc)
platformPluginPath = QString::fromLocal8Bit(argv[i]);
platformPluginPath = QFile::decodeName(argv[i]);
} else if (strcmp(arg, "-platform") == 0) {
if (++i < argc) {
platformExplicitlySelected = true;
@ -1462,7 +1462,7 @@ void QGuiApplicationPrivate::createPlatformIntegration()
firstWindowTitle = QString::fromLocal8Bit(argv[i]);
} else if (strcmp(arg, "-qwindowicon") == 0 || (xcbIsDefault && strcmp(arg, "-icon") == 0)) {
if (++i < argc) {
icon = QString::fromLocal8Bit(argv[i]);
icon = QFile::decodeName(argv[i]);
}
} else {
argv[j++] = argv[i];