diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-04-14 15:26:15 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-04-15 12:24:20 +0000 |
commit | d45dea6cf82e9a46b4c980f4562315d9366bf9dd (patch) | |
tree | 951d8f2cf6e542f354fd60280440f7d0ee3efe2b /src/plugins/vcsbase | |
parent | 7668d4388b08864764f1a8e588070320d8d0bcce (diff) |
Git: Move executeGit into VcsBaseClientImpl
and rename it to vcsExec. Accept a QVariant to set as cookie on the
command instead of a int for the linenumber.
Change-Id: I8240b53e775ac3883f92bdbf7b111abeeeb39426
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.cpp | 12 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 2fc461560e..cef245d051 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -216,6 +216,18 @@ bool VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const return result; } +VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QStringList &arguments, + VcsBaseEditorWidget *editor, bool useOutputToWindow, + unsigned additionalFlags, const QVariant &cookie) +{ + VcsCommand *command = createCommand(workingDirectory, editor, + useOutputToWindow ? VcsWindowOutputBind : NoOutputBind); + command->setCookie(cookie); + command->addFlags(additionalFlags); + enqueueJob(command, arguments); + return command; +} + Utils::SynchronousProcessResponse VcsBaseClientImpl::vcsSynchronousExec(const QString &workingDir, const QStringList &args, unsigned flags, diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index eaf8f28da2..8fdf6971f2 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -115,6 +115,11 @@ protected: QByteArray *outputData, QByteArray *errorData = 0, unsigned flags = 0) const; + // Simple helper to execute a single command using createCommand and enqueueJob. + VcsCommand *vcsExec(const QString &workingDirectory, const QStringList &arguments, + VcsBaseEditorWidget *editor = 0, bool useOutputToWindow = false, + unsigned additionalFlags = 0, const QVariant &cookie = QVariant()); + // Synchronous VCS execution using Utils::SynchronousProcess, with // log windows updating (using VcsBasePlugin::runVcs with flags) Utils::SynchronousProcessResponse vcsSynchronousExec(const QString &workingDir, |