diff --git a/src/qml/Chat/Composer.qml b/src/qml/Chat/Composer.qml index 0ac531d9..e44573aa 100644 --- a/src/qml/Chat/Composer.qml +++ b/src/qml/Chat/Composer.qml @@ -185,9 +185,8 @@ Rectangle { eventList.selectableLabelContainer.joinedSelection ) { ev.accepted = true - Utils.copyToClipboard( - eventList.selectableLabelContainer.joinedSelection, - ) + Clipboard.text = + eventList.selectableLabelContainer.joinedSelection return } diff --git a/src/qml/Chat/Timeline/EventDelegate.qml b/src/qml/Chat/Timeline/EventDelegate.qml index 003e87ec..bdb10209 100644 --- a/src/qml/Chat/Timeline/EventDelegate.qml +++ b/src/qml/Chat/Timeline/EventDelegate.qml @@ -136,7 +136,7 @@ Column { qsTr("Copy media address") visible: Boolean(text) - onTriggered: Utils.copyToClipboard(contextMenu.media[1]) + onTriggered: Clipboard.text = contextMenu.media[1] } HMenuItem { @@ -144,7 +144,7 @@ Column { icon.name: "copy-link" text: qsTr("Copy link address") visible: Boolean(contextMenu.link) - onTriggered: Utils.copyToClipboard(contextMenu.link) + onTriggered: Clipboard.text = contextMenu.link } HMenuItem { @@ -153,7 +153,7 @@ Column { visible: enabled || (! copyLink.visible && ! copyMedia.visible) enabled: Boolean(selectableLabelContainer.joinedSelection) onTriggered: - Utils.copyToClipboard(selectableLabelContainer.joinedSelection) + Clipboard.text = selectableLabelContainer.joinedSelection } HMenuItem { diff --git a/src/qml/Window.qml b/src/qml/Window.qml index 4aabbee7..b2311b8c 100644 --- a/src/qml/Window.qml +++ b/src/qml/Window.qml @@ -35,17 +35,9 @@ ApplicationWindow { property var theme: null readonly property alias py: py - readonly property alias pseudoClipboard: pseudoClipboard Python { id: py } - TextEdit { - id: pseudoClipboard - visible: false - readOnly: true - textFormat: Text.PlainText - } - HLoader { anchors.fill: parent source: py.ready ? "" : "LoadingScreen.qml" diff --git a/src/qml/utils.js b/src/qml/utils.js index 5975e6ae..5e048e67 100644 --- a/src/qml/utils.js +++ b/src/qml/utils.js @@ -280,14 +280,6 @@ function flickToBottom(flickable) { } -function copyToClipboard(text) { - window.pseudoClipboard.clear() - window.pseudoClipboard.insert(0, text) - window.pseudoClipboard.selectAll() - window.pseudoClipboard.copy() -} - - function urlExtension(url) { return url.toString().split("/").slice(-1)[0].split("?")[0].split(".") .slice(-1)[0].toLowerCase()