diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2020-06-18 00:04:17 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2020-06-21 06:47:20 +0000 |
commit | 92a4c0d38a007f778893f7b971f747e1a803eac3 (patch) | |
tree | 86f1a65f2200154141b80a4d3026c8dc3f358099 /src/plugins/git | |
parent | cb0b8556c81437dc02ca3abd9cca26ef44ad6c28 (diff) |
VCS: Pass links to the correct VCS
Current implementation requires each VCS to connect to the referenceClicked
signal. Only Git does it, but this is conceptually wrong. If other VCSs
would connect to the same signal, all of them will act upon clicking a
link, which can result in multiple editors, most of them are likely to be
invalid anyway.
By default executes vcsDescribe. Can be extended or modified by subclasses.
Change-Id: Ib953009efd77446a4b2963f0aa8a2f3f3d26509f
Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/git')
-rw-r--r-- | src/plugins/git/gitplugin.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index d256ff4e2f..6a17e89f08 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -271,6 +271,15 @@ public: GitClient::addChangeActions(menu, workingDirectory, reference); } + bool handleLink(const QString &workingDirectory, const QString &reference) final + { + if (reference.contains("..")) + GitClient::instance()->log(workingDirectory, {}, false, {reference}); + else + GitClient::instance()->show(workingDirectory, reference); + return true; + } + RepoUrl getRepoUrl(const QString &location) const override; QStringList additionalToolsPath() const final; @@ -1001,16 +1010,6 @@ GitPluginPrivate::GitPluginPrivate() m_gerritPlugin->updateActions(currentState()); m_gerritPlugin->addToLocator(m_commandLocator); - connect(VcsOutputWindow::instance(), &VcsOutputWindow::referenceClicked, - this, [this](const QString &name) { - const VcsBasePluginState state = currentState(); - QTC_ASSERT(state.hasTopLevel(), return); - if (name.contains("..")) - m_gitClient.log(state.topLevel(), {}, false, {name}); - else - m_gitClient.show(state.topLevel(), name); - }); - } void GitPluginPrivate::diffCurrentFile() |