forked from qt-creator/qt-creator
Git: Use QtcProcess in GitClient
Change-Id: Ia92d803ea8f647681ab5ffe51fa9a55bd5924df7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -2561,9 +2561,9 @@ void GitClient::launchGitK(const FilePath &workingDirectory, const QString &file
|
|||||||
|
|
||||||
void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const
|
void GitClient::launchRepositoryBrowser(const FilePath &workingDirectory) const
|
||||||
{
|
{
|
||||||
const QString repBrowserBinary = settings().repositoryBrowserCmd.value();
|
const FilePath repBrowserBinary = settings().repositoryBrowserCmd.filePath();
|
||||||
if (!repBrowserBinary.isEmpty())
|
if (!repBrowserBinary.isEmpty())
|
||||||
QProcess::startDetached(repBrowserBinary, {workingDirectory.toString()}, workingDirectory.toString());
|
QtcProcess::startDetached({repBrowserBinary, {workingDirectory.toString()}}, workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::tryLauchingGitK(const Environment &env,
|
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.
|
// 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()) {
|
||||||
auto process = new QProcess;
|
auto process = new QtcProcess;
|
||||||
process->setWorkingDirectory(workingDirectory.toString());
|
process->setWorkingDirectory(workingDirectory);
|
||||||
process->setProcessEnvironment(env.toProcessEnvironment());
|
process->setEnvironment(env);
|
||||||
process->start(binary.toString(), arguments);
|
process->setCommand({binary, arguments});
|
||||||
|
process->start();
|
||||||
success = process->waitForStarted();
|
success = process->waitForStarted();
|
||||||
if (success)
|
if (success)
|
||||||
connect(process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
connect(process, &QtcProcess::finished, process, &QProcess::deleteLater);
|
||||||
process, &QProcess::deleteLater);
|
|
||||||
else
|
else
|
||||||
delete process;
|
delete process;
|
||||||
} else {
|
} else {
|
||||||
success = QProcess::startDetached(binary.toString(), arguments, workingDirectory.toString());
|
success = QtcProcess::startDetached({binary, arguments}, workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
|||||||
Reference in New Issue
Block a user