From 916e7465f1fbec79b2c24b49a509498a0201aa54 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 18 Jul 2022 21:18:48 +0200 Subject: [PATCH] Don't show a link preview for empty links When hovering over a link without a target, qt5 will report the link target to be "1", which is wrong. To work around this, we manually check if the link is "1" and if it is, we discard it. In theory, this means that we won't get a preview for any link that actually *is* "1", but why would any link be "1"? It's not worth reporting this to Qt since it seems fixed in Qt6 BUG: 456877 --- imports/NeoChat/Component/Timeline/RichLabel.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/NeoChat/Component/Timeline/RichLabel.qml b/imports/NeoChat/Component/Timeline/RichLabel.qml index e8ec6f081..92e633d3b 100644 --- a/imports/NeoChat/Component/Timeline/RichLabel.qml +++ b/imports/NeoChat/Component/Timeline/RichLabel.qml @@ -59,7 +59,7 @@ a{ textFormat: Text.RichText onLinkActivated: RoomManager.openResource(link) - onHoveredLinkChanged: if (hoveredLink.length > 0) { + onHoveredLinkChanged: if (hoveredLink.length > 0 && hoveredLink !== "1") { applicationWindow().hoverLinkIndicator.text = hoveredLink; } else { applicationWindow().hoverLinkIndicator.text = "";