Vcs: Use QtcProcess

Change-Id: I5fb19144b17b817a783fcf927f3a74dbdaaa97ab
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Artem Sokolovskii
2021-08-25 13:44:16 +02:00
parent 244e940c94
commit 48b4af21aa
2 changed files with 6 additions and 7 deletions

View File

@@ -2344,7 +2344,7 @@ void ClearCasePluginPrivate::diffGraphical(const QString &file1, const QString &
args << file1; args << file1;
if (!pred) if (!pred)
args << file2; args << file2;
QProcess::startDetached(m_settings.ccBinaryPath, args, m_topLevel.toString()); QtcProcess::startDetached({FilePath::fromString(m_settings.ccBinaryPath), args}, m_topLevel);
} }
QString ClearCasePluginPrivate::runExtDiff(const FilePath &workingDir, const QStringList &arguments, QString ClearCasePluginPrivate::runExtDiff(const FilePath &workingDir, const QStringList &arguments,

View File

@@ -2587,7 +2587,7 @@ bool GitClient::tryLauchingGitK(const Environment &env,
if (!fileName.isEmpty()) if (!fileName.isEmpty())
arguments << "--" << fileName; arguments << "--" << fileName;
VcsOutputWindow::appendCommand(workingDirectory, {binary, arguments}); VcsOutputWindow::appendCommand(workingDirectory, {binary, arguments});
// This should always use QProcess::startDetached (as not to kill // This should always use QtcProcess::startDetached (as not to kill
// the child), but that does not have an environment parameter. // the child), but that does not have an environment parameter.
bool success = false; bool success = false;
if (!settings().path.value().isEmpty()) { if (!settings().path.value().isEmpty()) {
@@ -2614,8 +2614,7 @@ bool GitClient::launchGitGui(const FilePath &workingDirectory) {
if (gitBinary.isEmpty()) { if (gitBinary.isEmpty()) {
success = false; success = false;
} else { } else {
success = QProcess::startDetached(gitBinary.toString(), {"gui"}, success = QtcProcess::startDetached({gitBinary, {"gui"}}, workingDirectory);
workingDirectory.toString());
} }
if (!success) if (!success)
@@ -2654,13 +2653,13 @@ FilePath GitClient::gitBinDirectory() const
bool GitClient::launchGitBash(const FilePath &workingDirectory) bool GitClient::launchGitBash(const FilePath &workingDirectory)
{ {
bool success = true; bool success = true;
const QString git = vcsBinary().toString(); const FilePath git = vcsBinary();
if (git.isEmpty()) { if (git.isEmpty()) {
success = false; success = false;
} else { } else {
const QString gitBash = QFileInfo(git).absolutePath() + "/../git-bash.exe"; const FilePath gitBash = git.absolutePath().parentDir() / "git-bash.exe";
success = QProcess::startDetached(gitBash, {}, workingDirectory.toString()); success = QtcProcess::startDetached({gitBash, {}}, workingDirectory);
} }
if (!success) if (!success)