From b79f3c1f075bc093a11e5625b0c161a880bc36e7 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 18 Oct 2019 13:02:35 +0200 Subject: [PATCH] ProjectExplorer: Make missing command more obvious In custom process steps, instead of showing ''. Change-Id: I6e3cd1eefa9f41c787e7da4ab917668e23c3d662 Reviewed-by: Leena Miettinen Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/processparameters.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/projectexplorer/processparameters.cpp b/src/plugins/projectexplorer/processparameters.cpp index d8b91e49b98..6d7c78b22a6 100644 --- a/src/plugins/projectexplorer/processparameters.cpp +++ b/src/plugins/projectexplorer/processparameters.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -169,8 +170,19 @@ QString ProcessParameters::prettyArguments() const return args.toString(); } +static QString invalidCommandMessage(const QString &displayName) +{ + return QString("%1: %2") + .arg(displayName, + QtcProcess::tr("Invalid command"), + creatorTheme()->color(Theme::TextColorError).name()); +} + QString ProcessParameters::summary(const QString &displayName) const { + if (m_commandMissing) + return invalidCommandMessage(displayName); + return QString::fromLatin1("%1: %2 %3") .arg(displayName, Utils::QtcProcess::quoteArg(prettyCommand()), @@ -179,6 +191,9 @@ QString ProcessParameters::summary(const QString &displayName) const QString ProcessParameters::summaryInWorkdir(const QString &displayName) const { + if (m_commandMissing) + return invalidCommandMessage(displayName); + return QString::fromLatin1("%1: %2 %3 in %4") .arg(displayName, Utils::QtcProcess::quoteArg(prettyCommand()),