Fix copying event when no selection or focused

This commit is contained in:
miruka 2020-04-03 05:36:55 -04:00
parent af861ac13a
commit d991d04a8c
2 changed files with 4 additions and 2 deletions

View File

@ -210,7 +210,7 @@ HColumnLayout {
qsTr("Copy text") qsTr("Copy text")
onTriggered: { onTriggered: {
if (! eventList.selectedCount && eventList.currentItem === -1){ if (! eventList.selectedCount && ! eventList.currentItem){
Clipboard.text = JSON.parse(model.source).body Clipboard.text = JSON.parse(model.source).body
return return
} }

View File

@ -203,7 +203,9 @@ QtObject {
return ev.content return ev.content
if (type === "RedactedEvent") { 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) let content = qsTr(escapeHtml(ev.content)).arg(sender)
if (ev.content.includes("%2")) if (ev.content.includes("%2"))