diff options
author | Orgad Shaneh <[email protected]> | 2016-03-28 23:13:59 +0300 |
---|---|---|
committer | Orgad Shaneh <[email protected]> | 2016-03-29 09:19:01 +0000 |
commit | a63681c1d2ae22d1074b1b70b9e7268e33d45395 (patch) | |
tree | 788ec457579d9a87f8deb1fdbd367ff5de6ae8b9 /src/plugins/vcsbase/vcsbaseclient.cpp | |
parent | 706fc6c00d5d168f63b8ff3f6ae3f5284486b250 (diff) |
VCS: Simplify editor/command connections
* Move all the connections to setCommand()
* Move gotoLine logic to reportCommandFinished
Change-Id: I67ad74820b3d20b2b5fa97edad92f0f30111166f
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseclient.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index c21ea9ae221..970225765f7 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -51,17 +51,6 @@ #include <QVariant> #include <QProcessEnvironment> -static void commandFinished(VcsBase::VcsBaseEditorWidget *editor, VcsBase::VcsCommand *cmd) -{ - if (!cmd->lastExecutionSuccess()) { - editor->reportCommandFinished(false, cmd->lastExecutionExitCode(), cmd->cookie()); - } else if (cmd->cookie().type() == QVariant::Int) { - const int line = cmd->cookie().toInt(); - if (line >= 0) - editor->gotoLine(line); - } -} - /*! \class VcsBase::VcsBaseClient @@ -131,12 +120,8 @@ VcsCommand *VcsBaseClientImpl::createCommand(const QString &workingDirectory, { auto cmd = new VcsCommand(workingDirectory, processEnvironment()); cmd->setDefaultTimeoutS(vcsTimeoutS()); - if (editor) { + if (editor) editor->setCommand(cmd); - connect(editor, &QObject::destroyed, cmd, &VcsCommand::abort); - connect(cmd, &VcsCommand::finished, - editor, [editor, cmd]() { commandFinished(editor, cmd); }); - } if (mode == VcsWindowOutputBind) { cmd->addFlags(VcsCommand::ShowStdOut); if (editor) // assume that the commands output is the important thing |