diff options
author | hjk <[email protected]> | 2021-08-20 08:44:58 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2021-08-20 12:14:51 +0000 |
commit | 2adaea866f2e08e3fa27a8da6283f8fb2c3cd743 (patch) | |
tree | 11ed691d17b612411cd75db596e550781ef3fe09 /src/plugins/git/gitclient.cpp | |
parent | dce88c29a780e941dd0112ca778f664c1b6f4d82 (diff) |
Git: Use QtcProcess in GitClient
Change-Id: Ia92d803ea8f647681ab5ffe51fa9a55bd5924df7
Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r-- | src/plugins/git/gitclient.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index e2a464baff3..9f18a28324c 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2561,9 +2561,9 @@ void GitClient::launchGitK(const FilePath &workingDirectory, const QString &file void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const { - const QString repBrowserBinary = settings().repositoryBrowserCmd.value(); + const FilePath repBrowserBinary = settings().repositoryBrowserCmd.filePath(); if (!repBrowserBinary.isEmpty()) - QProcess::startDetached(repBrowserBinary, {workingDirectory.toString()}, workingDirectory.toString()); + QtcProcess::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory); } bool GitClient::tryLauchingGitK(const Environment &env, @@ -2591,18 +2591,18 @@ bool GitClient::tryLauchingGitK(const Environment &env, // the child), but that does not have an environment parameter. bool success = false; if (!settings().path.value().isEmpty()) { - auto process = new QProcess; - process->setWorkingDirectory(workingDirectory.toString()); - process->setProcessEnvironment(env.toProcessEnvironment()); - process->start(binary.toString(), arguments); + auto process = new QtcProcess; + process->setWorkingDirectory(workingDirectory); + process->setEnvironment(env); + process->setCommand({binary, arguments}); + process->start(); success = process->waitForStarted(); if (success) - connect(process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), - process, &QProcess::deleteLater); + connect(process, &QtcProcess::finished, process, &QProcess::deleteLater); else delete process; } else { - success = QProcess::startDetached(binary.toString(), arguments, workingDirectory.toString()); + success = QtcProcess::startDetached({binary, arguments}, workingDirectory); } return success; |