aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/subversion
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2021-05-12 14:25:50 +0200
committerhjk <hjk@qt.io>2021-05-14 13:19:01 +0000
commit55f768e1b0a2f49977a48972b243d3efa255e337 (patch)
tree004b6e589d3589c2a11335f59b7a6e1380a859a7 /src/plugins/subversion
parentf23b27ded6bc4f7859ff2091b957213fa4597fe9 (diff)
Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra SynchronousProcessResponse structure only causes copies of the data and complicates access on the user side in a lot of cases. The result bits are now also accessible individually. There's obvious room for follow-up changes on the topic, e.g. ShellCommand::runCommand's parameter list could shrink to just a SynchronousProcess parameter. Change-Id: I45aa7eb23832340be06905929280c012e1217263 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/subversion')
-rw-r--r--src/plugins/subversion/subversionclient.cpp16
-rw-r--r--src/plugins/subversion/subversionplugin.cpp12
2 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp
index 2a21a2d51b7..e7dc99f0016 100644
--- a/src/plugins/subversion/subversionclient.cpp
+++ b/src/plugins/subversion/subversionclient.cpp
@@ -91,10 +91,10 @@ bool SubversionClient::doCommit(const QString &repositoryRoot,
<< QLatin1String("--file") << commitMessageFile;
QStringList args(vcsCommandString(CommitCommand));
- SynchronousProcessResponse resp =
- vcsSynchronousExec(repositoryRoot, args << svnExtraOptions << escapeFiles(files),
- VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
- return resp.result == SynchronousProcessResponse::Finished;
+ SynchronousProcess proc;
+ vcsSynchronousExec(proc, repositoryRoot, args << svnExtraOptions << escapeFiles(files),
+ VcsCommand::ShowStdOut | VcsCommand::NoFullySync);
+ return proc.result() == QtcProcess::Finished;
}
void SubversionClient::commit(const QString &repositoryRoot,
@@ -151,12 +151,12 @@ QString SubversionClient::synchronousTopic(const QString &repository) const
else
svnVersionBinary = svnVersionBinary.left(pos + 1);
svnVersionBinary.append(HostOsInfo::withExecutableSuffix("svnversion"));
- const SynchronousProcessResponse result
- = vcsFullySynchronousExec(repository, {svnVersionBinary, args});
- if (result.result != SynchronousProcessResponse::Finished)
+ SynchronousProcess proc;
+ vcsFullySynchronousExec(proc, repository, {svnVersionBinary, args});
+ if (proc.result() != QtcProcess::Finished)
return QString();
- return result.stdOut().trimmed();
+ return proc.stdOut().trimmed();
}
QString SubversionClient::escapeFile(const QString &file)
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index fa16f7180b3..3a878ffa312 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -1026,14 +1026,14 @@ SubversionResponse SubversionPluginPrivate::runSvn(const QString &workingDir,
return response;
}
- const SynchronousProcessResponse sp_resp
- = m_client->vcsFullySynchronousExec(workingDir, arguments, flags, timeOutS, outputCodec);
+ SynchronousProcess proc;
+ m_client->vcsFullySynchronousExec(proc, workingDir, arguments, flags, timeOutS, outputCodec);
- response.error = sp_resp.result != SynchronousProcessResponse::Finished;
+ response.error = proc.result() != QtcProcess::Finished;
if (response.error)
- response.message = sp_resp.exitMessage(m_settings.binaryPath.value(), timeOutS);
- response.stdErr = sp_resp.stdErr();
- response.stdOut = sp_resp.stdOut();
+ response.message = proc.exitMessage(m_settings.binaryPath.value(), timeOutS);
+ response.stdErr = proc.stdErr();
+ response.stdOut = proc.stdOut();
return response;
}