summaryrefslogtreecommitdiffstats
path: root/src/tools/windeployqt/utils.cpp
diff options
context:
space:
mode:
authorOliver Wolff <[email protected]>2023-12-01 10:49:39 +0100
committerQt Cherry-pick Bot <[email protected]>2023-12-13 15:24:13 +0000
commita370d39acfe4e9c5e75873bd8433ea0a02a669e9 (patch)
tree9b7a516fc02c4e933421ad7f3e0a0a76beaf6de1 /src/tools/windeployqt/utils.cpp
parent20904f131534967117a4f7941b9630f2604ff7f5 (diff)
windeployqt: Proper error message when qtpaths.bat/.exe could not be run
If qtpaths cannt be found windeployqt should complain about that fact. Previously it complained about "Unsupported platform". Change-Id: I4db954633c31ceac69c4d3c0e55cbe942c3272fd Reviewed-by: Joerg Bornemann <[email protected]> (cherry picked from commit bf2f4678b0c1a17ad8d18809335cfb69d2c6527a) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit b876d260b698b3f942796a28cca517761f26f530) (cherry picked from commit 781a17d783fe246ccce4e22ff3d23e8edc4b45a5)
Diffstat (limited to 'src/tools/windeployqt/utils.cpp')
-rw-r--r--src/tools/windeployqt/utils.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/windeployqt/utils.cpp b/src/tools/windeployqt/utils.cpp
index 54186259ad8..7f01953e39d 100644
--- a/src/tools/windeployqt/utils.cpp
+++ b/src/tools/windeployqt/utils.cpp
@@ -424,14 +424,18 @@ const char *qmakeInfixKey = "QT_INFIX";
QMap<QString, QString> queryQtPaths(const QString &qtpathsBinary, QString *errorMessage)
{
const QString binary = !qtpathsBinary.isEmpty() ? qtpathsBinary : QStringLiteral("qtpaths");
+ const QString colonSpace = QStringLiteral(": ");
QByteArray stdOut;
QByteArray stdErr;
unsigned long exitCode = 0;
- if (!runProcess(binary, QStringList(QStringLiteral("-query")), QString(), &exitCode, &stdOut, &stdErr, errorMessage))
+ if (!runProcess(binary, QStringList(QStringLiteral("-query")), QString(), &exitCode, &stdOut,
+ &stdErr, errorMessage)) {
+ *errorMessage = QStringLiteral("Error running binary ") + binary + colonSpace + *errorMessage;
return QMap<QString, QString>();
+ }
if (exitCode) {
*errorMessage = binary + QStringLiteral(" returns ") + QString::number(exitCode)
- + QStringLiteral(": ") + QString::fromLocal8Bit(stdErr);
+ + colonSpace + QString::fromLocal8Bit(stdErr);
return QMap<QString, QString>();
}
const QString output = QString::fromLocal8Bit(stdOut).trimmed().remove(u'\r');
@@ -467,7 +471,7 @@ QMap<QString, QString> queryQtPaths(const QString &qtpathsBinary, QString *error
}
} else {
std::wcerr << "Warning: Unable to read " << QDir::toNativeSeparators(qconfigPriFile.fileName())
- << ": " << qconfigPriFile.errorString()<< '\n';
+ << colonSpace << qconfigPriFile.errorString()<< '\n';
}
return result;
}