diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-08 20:52:03 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-12-09 10:29:36 +0000 |
commit | 46213c82be82124be7fcdcb15bceecf2d174052d (patch) | |
tree | c9e2daee3966f0c348e43d2150013635f3ac97e7 | |
parent | 0cdfac0cb5ee692576276393e4999d91a6689e25 (diff) | |
download | qt-creator-46213c82be82124be7fcdcb15bceecf2d174052d.tar.gz |
GitClient: Simplify vcsExec
Get rid of editor arg.
Reorder last two args (to conform to vcsExecWithHandler).
Change-Id: Ia32757ac8b766640b76bef81f1b2e0f5efe4d48c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r-- | src/plugins/git/gitclient.cpp | 8 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.cpp | 8 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.h | 6 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 57fd4d1eb1..5e0f104f21 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1308,7 +1308,7 @@ void GitClient::archive(const FilePath &workingDirectory, QString commit) } } - vcsExec(workingDirectory, {"archive", commit, "-o", archive.absoluteFilePath()}, nullptr, true); + vcsExec(workingDirectory, {"archive", commit, "-o", archive.absoluteFilePath()}); } VcsBaseEditorWidget *GitClient::annotate( @@ -1457,7 +1457,7 @@ void GitClient::reset(const FilePath &workingDirectory, const QString &argument, } flags |= RunFlags::ExpectRepoChanges; } - vcsExec(workingDirectory, arguments, nullptr, true, flags); + vcsExec(workingDirectory, arguments, flags); } void GitClient::removeStaleRemoteBranches(const FilePath &workingDirectory, const QString &remote) @@ -1489,7 +1489,7 @@ void GitClient::recoverDeletedFiles(const FilePath &workingDirectory) void GitClient::addFile(const FilePath &workingDirectory, const QString &fileName) { - vcsExec(workingDirectory, {"add", fileName}); + vcsExec(workingDirectory, {"add", fileName}, RunFlags::None, false); } bool GitClient::synchronousLog(const FilePath &workingDirectory, const QStringList &arguments, @@ -3234,7 +3234,7 @@ void GitClient::subversionLog(const FilePath &workingDirectory) const void GitClient::subversionDeltaCommit(const FilePath &workingDirectory) const { - vcsExec(workingDirectory, {"svn", "dcommit"}, nullptr, true, RunFlags::ShowSuccessMessage); + vcsExec(workingDirectory, {"svn", "dcommit"}, RunFlags::ShowSuccessMessage); } enum class PushFailure { Unknown, NonFastForward, NoRemoteBranch }; diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index a622016d5d..91ada109e1 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -180,14 +180,12 @@ void VcsBaseClientImpl::vcsExecWithHandler(const FilePath &workingDirectory, void VcsBaseClientImpl::vcsExec(const FilePath &workingDirectory, const QStringList &arguments, - VcsBaseEditorWidget *editor, bool useOutputToWindow, - RunFlags additionalFlags) const + RunFlags additionalFlags, + bool useOutputToWindow) const { - VcsCommand *command = createCommand(workingDirectory, editor, + VcsCommand *command = createCommand(workingDirectory, nullptr, useOutputToWindow ? VcsWindowOutputBind : NoOutputBind); command->addFlags(additionalFlags); - if (editor) - command->setCodec(editor->codec()); command->addJob({vcsBinary(), arguments}, vcsTimeoutS()); command->start(); } diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index e22fb509eb..abd901a85c 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -93,12 +93,10 @@ public: const CommandHandler &handler, RunFlags additionalFlags = RunFlags::None, bool useOutputToWindow = true) const; - // Simple helper to execute a single command using createCommand and enqueueJob. void vcsExec(const Utils::FilePath &workingDirectory, const QStringList &arguments, - VcsBaseEditorWidget *editor = nullptr, - bool useOutputToWindow = false, - RunFlags additionalFlags = RunFlags::None) const; + RunFlags additionalFlags = RunFlags::None, + bool useOutputToWindow = true) const; void vcsExecWithEditor(const Utils::FilePath &workingDirectory, const QStringList &arguments, VcsBaseEditorWidget *editor) const; |