VCS: Use more FilePath in ShellCommand and surroundings

Change-Id: Ie8c5fac09b45a54bcbe9a876044b653e7fccede5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk
2021-08-11 10:02:58 +02:00
parent 2aaa0a2180
commit bbde6ac9bf
21 changed files with 84 additions and 83 deletions

View File

@@ -460,14 +460,11 @@ static inline QString formatArguments(const QStringList &args)
return rc;
}
QString VcsOutputWindow::msgExecutionLogEntry(const QString &workingDir, const CommandLine &command)
QString VcsOutputWindow::msgExecutionLogEntry(const FilePath &workingDir, const CommandLine &command)
{
const QString args = formatArguments(command.splitArguments());
const QString nativeExecutable = ProcessArgs::quoteArg(command.executable().toUserOutput());
if (workingDir.isEmpty())
return tr("Running: %1 %2").arg(nativeExecutable, args) + '\n';
return tr("Running in %1: %2 %3").
arg(QDir::toNativeSeparators(workingDir), nativeExecutable, args) + '\n';
return tr("Running: %1").arg(command.toUserOutput()) + '\n';
return tr("Running in %1: %2").arg(workingDir.toUserOutput(), command.toUserOutput()) + '\n';
}
void VcsOutputWindow::appendShellCommandLine(const QString &text)
@@ -475,7 +472,7 @@ void VcsOutputWindow::appendShellCommandLine(const QString &text)
append(filterPasswordFromUrls(text), Command, true);
}
void VcsOutputWindow::appendCommand(const QString &workingDirectory, const CommandLine &command)
void VcsOutputWindow::appendCommand(const FilePath &workingDirectory, const CommandLine &command)
{
appendShellCommandLine(msgExecutionLogEntry(workingDirectory, command));
}