From 912cd7c90a2564b06fd362ce08d7693d4d3927ba Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 17 May 2024 09:59:34 +0200 Subject: [PATCH] remove dontSendClipboard hack --- core/remoteview.cpp | 9 ++++----- core/remoteview.h | 1 - vnc/vncview.cpp | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/remoteview.cpp b/core/remoteview.cpp index 7ff7ce7b..68c23ec7 100644 --- a/core/remoteview.cpp +++ b/core/remoteview.cpp @@ -28,7 +28,6 @@ RemoteView::RemoteView(QWidget *parent) , m_keyboardIsGrabbed(false) , m_factor(0.) , m_clipboard(nullptr) - , m_dontSendClipboard(false) #ifndef QTONLY , m_wallet(nullptr) #endif @@ -319,7 +318,7 @@ void RemoteView::localClipboardChanged() return; } - if (m_clipboard->ownsClipboard() || m_dontSendClipboard) { + if (m_clipboard->ownsClipboard() || m_viewOnly) { return; } @@ -331,10 +330,10 @@ void RemoteView::localClipboardChanged() void RemoteView::remoteClipboardChanged(QMimeData *data) { - const bool saved_dontSendClipboard = m_dontSendClipboard; - m_dontSendClipboard = true; + if (m_viewOnly) { + return; + } m_clipboard->setMimeData(data, QClipboard::Clipboard); - m_dontSendClipboard = saved_dontSendClipboard; } #include "moc_remoteview.cpp" diff --git a/core/remoteview.h b/core/remoteview.h index 7cd0ca14..cb871437 100644 --- a/core/remoteview.h +++ b/core/remoteview.h @@ -423,7 +423,6 @@ protected: QUrl m_url; qreal m_factor; QClipboard *m_clipboard; - bool m_dontSendClipboard; #ifndef QTONLY QString readWalletPassword(bool fromUserNameOnly = false); diff --git a/vnc/vncview.cpp b/vnc/vncview.cpp index 5079aa82..ce0f97a3 100644 --- a/vnc/vncview.cpp +++ b/vnc/vncview.cpp @@ -474,8 +474,6 @@ void VncView::setViewOnly(bool viewOnly) { RemoteView::setViewOnly(viewOnly); - m_dontSendClipboard = viewOnly; - if (viewOnly) setCursor(Qt::ArrowCursor); else