From d991d04a8cd98be3679aa44c4be1eab8d79c8322 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 3 Apr 2020 05:36:55 -0400 Subject: [PATCH] Fix copying event when no selection or focused --- src/gui/Pages/Chat/Timeline/EventDelegate.qml | 2 +- src/gui/Utils.qml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/Pages/Chat/Timeline/EventDelegate.qml b/src/gui/Pages/Chat/Timeline/EventDelegate.qml index 30f6ac29..b776ad7c 100644 --- a/src/gui/Pages/Chat/Timeline/EventDelegate.qml +++ b/src/gui/Pages/Chat/Timeline/EventDelegate.qml @@ -210,7 +210,7 @@ HColumnLayout { qsTr("Copy text") onTriggered: { - if (! eventList.selectedCount && eventList.currentItem === -1){ + if (! eventList.selectedCount && ! eventList.currentItem){ Clipboard.text = JSON.parse(model.source).body return } diff --git a/src/gui/Utils.qml b/src/gui/Utils.qml index aae2e955..48b0061b 100644 --- a/src/gui/Utils.qml +++ b/src/gui/Utils.qml @@ -203,7 +203,9 @@ QtObject { return ev.content if (type === "RedactedEvent") { - print("c", ev.content) + // FIXME: this can generate an "argument missing" warning because + // QML first gets notified of the event type change, *then* of the + // content change. let content = qsTr(escapeHtml(ev.content)).arg(sender) if (ev.content.includes("%2"))