From 0eb99f5498c1a0e0c7bb6bdd28de39579e75e0a5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 25 Nov 2024 11:36:25 +0100 Subject: [PATCH] VCS: Fix issues with clicking on links in output view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends cb6a2da37223fa34f4e173e2ed64118f735d6c92 that started clearing the static repository information from the output view. The issue with that is that it clears that information even for asynchronous vcs commands that do not have anything to do with the output view at all. The code before was mostly wrong already, but the information was never cleared it mostly worked out. It would be good to get rid of the static information about the repository from the output view, and instead provid the repository information for each output that is added. But this patch is a band aid for Qt Creator 15: - set the repository information again before appending messages from a vcs command to the output view - set the repository information also for runBlocking, which also broke in the above commit Task-number: QTCREATORBUG-31894 Change-Id: I0823b53e0fbecc14961be905f5279eb5a461ab93 Reviewed-by: André Hartmann --- src/plugins/vcsbase/vcscommand.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index a10586458ec..61c6fe36431 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -128,6 +128,7 @@ void VcsCommandPrivate::installStdCallbacks(Process *process) || m_progressParser || !(m_flags & RunFlags::SuppressStdErr))) { process->setTextChannelMode(Channel::Error, TextChannelMode::MultiLine); connect(process, &Process::textOnStandardError, this, [this](const QString &text) { + VcsOutputWindow::setRepository(m_defaultWorkingDirectory); if (!(m_flags & RunFlags::SuppressStdErr)) VcsOutputWindow::appendError(text); if (m_flags & RunFlags::ProgressiveOutput) @@ -138,6 +139,7 @@ void VcsCommandPrivate::installStdCallbacks(Process *process) || m_flags & RunFlags::ShowStdOut) { process->setTextChannelMode(Channel::Output, TextChannelMode::MultiLine); connect(process, &Process::textOnStandardOutput, this, [this](const QString &text) { + VcsOutputWindow::setRepository(m_defaultWorkingDirectory); if (m_flags & RunFlags::ShowStdOut) VcsOutputWindow::append(text); if (m_flags & RunFlags::ProgressiveOutput) @@ -305,6 +307,7 @@ CommandResult VcsCommand::runBlockingHelper(const CommandLine &command, int time return {}; const Internal::VcsCommandPrivate::Job job{command, timeoutS, d->m_defaultWorkingDirectory}; + VcsOutputWindow::setRepository(d->m_defaultWorkingDirectory); d->setupProcess(&process, job); const EventLoopMode eventLoopMode = d->eventLoopMode();