forked from qt-creator/qt-creator
TextEditor: Allow opening links without filename
... in editors displaying a document without a filename. Change-Id: I857018e2532b406a37983d8fd77e52daa31ae70d Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -6927,9 +6927,6 @@ bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit)
|
|||||||
} s;
|
} s;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!link.hasValidTarget())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
QString url = link.targetFilePath.toString();
|
QString url = link.targetFilePath.toString();
|
||||||
if (url.startsWith(u"https://"_qs) || url.startsWith(u"http://"_qs)) {
|
if (url.startsWith(u"https://"_qs) || url.startsWith(u"http://"_qs)) {
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
@@ -6942,6 +6939,8 @@ bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit)
|
|||||||
setFocus();
|
setFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (!link.hasValidTarget())
|
||||||
|
return false;
|
||||||
EditorManager::OpenEditorFlags flags;
|
EditorManager::OpenEditorFlags flags;
|
||||||
if (inNextSplit)
|
if (inNextSplit)
|
||||||
flags |= EditorManager::OpenInOtherSplit;
|
flags |= EditorManager::OpenInOtherSplit;
|
||||||
|
|||||||
Reference in New Issue
Block a user