ProjectExplorer: Allow to open external URLs from tasks

Change-Id: I33e94b8d3ddfae7323544c7d834a9ca8bb625478
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2024-10-21 12:47:07 +02:00
parent 0bc70fdac1
commit 3fc9d4f862

View File

@@ -32,6 +32,7 @@
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
#include <QAbstractTextDocumentLayout> #include <QAbstractTextDocumentLayout>
#include <QDesktopServices>
#include <QLabel> #include <QLabel>
#include <QMenu> #include <QMenu>
#include <QPainter> #include <QPainter>
@@ -695,8 +696,14 @@ void TaskView::mouseReleaseEvent(QMouseEvent *e)
const QString anchor = anchorAt(e->pos()); const QString anchor = anchorAt(e->pos());
if (anchor == m_clickAnchor) { if (anchor == m_clickAnchor) {
Core::EditorManager::openEditorAt(OutputLineParser::parseLinkTarget(m_clickAnchor), {}, if (OutputLineParser::isLinkTarget(m_clickAnchor)) {
Core::EditorManager::SwitchSplitIfAlreadyVisible); EditorManager::openEditorAt(
OutputLineParser::parseLinkTarget(m_clickAnchor),
{},
EditorManager::SwitchSplitIfAlreadyVisible);
} else {
QDesktopServices::openUrl(QUrl(m_clickAnchor));
}
} }
m_clickAnchor.clear(); m_clickAnchor.clear();
} }