Windows QPA: fix mail launch in case parameter is wrong

Done-with: Ilya Fedin <fedin-ilja2010@ya.ru>
Pick-to: 6.6 6.5
Change-Id: I7b24ed64533cdf26f3f3d7dba4b5e80490be269c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
bb10
Yuhang Zhao 2023-05-23 17:57:56 +08:00 committed by Yuhang Zhao
parent 14d10c632b
commit b3930b03cd
1 changed files with 5 additions and 0 deletions

View File

@ -154,6 +154,11 @@ static inline bool launchMail(const QUrl &url)
qWarning("Cannot launch '%ls': There is no mail program installed.", qUtf16Printable(url.toString()));
return false;
}
// Fix mail launch if no param is expected in this command.
if (command.indexOf(QStringLiteral("%1")) < 0) {
qWarning() << "The mail command lacks the '%1' parameter.";
return false;
}
//Make sure the path for the process is in quotes
const QChar doubleQuote = u'"';
if (!command.startsWith(doubleQuote)) {