From 4153520fb6ad6be58f7bf4b6c729c8a1ce76dcb9 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 29 Nov 2023 10:57:46 +0100 Subject: [PATCH] TextEditor: Allow opening links without filename ... in editors displaying a document without a filename. Change-Id: I857018e2532b406a37983d8fd77e52daa31ae70d Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index f3fb4840d03..80d72a4ded8 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -6927,9 +6927,6 @@ bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit) } s; #endif - if (!link.hasValidTarget()) - return false; - QString url = link.targetFilePath.toString(); if (url.startsWith(u"https://"_qs) || url.startsWith(u"http://"_qs)) { QDesktopServices::openUrl(url); @@ -6942,6 +6939,8 @@ bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit) setFocus(); return true; } + if (!link.hasValidTarget()) + return false; EditorManager::OpenEditorFlags flags; if (inNextSplit) flags |= EditorManager::OpenInOtherSplit;