Skip to content

Commit 3a8a5f0

Browse files
committed
#3371 doc: update changelog, add some comments and remove debug message
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent e7b3679 commit 3a8a5f0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## 25.10.0
44

5+
- There now is a new menu action and tray icon action to **send the clipboard**
6+
content via the QOwnNotes web application to **another instance of QOwnNotes**
7+
(for [#3371](https://github.com/pbek/QOwnNotes/issues/3371))
8+
- You need to set the same security token in both instances to be able to
9+
send clipboard content
510
- A tooltip for the tray icon was added
611
- A crash on wayland was fixed when a global shortcut was set
712

src/services/webappclientservice.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <utils/misc.h>
2323

2424
#include <QApplication>
25+
#include <QBuffer>
2526
#include <QClipboard>
2627
#include <QJsonDocument>
2728
#include <QSslError>
@@ -69,6 +70,11 @@ void WebAppClientService::close() {
6970
_url = "";
7071
}
7172

73+
/**
74+
* Keeps the current clipboard content
75+
*
76+
* @return true if something was kept
77+
*/
7278
bool WebAppClientService::keepClipboard() {
7379
QClipboard *clipboard = QApplication::clipboard();
7480
const QMimeData *mimeData = clipboard->mimeData();
@@ -83,7 +89,6 @@ bool WebAppClientService::keepClipboard() {
8389
_clipboardMimeType = "image/png";
8490
_clipboardContent = content;
8591
} else if (mimeData->hasText()) {
86-
qDebug() << __func__ << "clipboard->text(): " << clipboard->text();
8792
_clipboardMimeType = "text/plain";
8893
_clipboardContent = clipboard->text();
8994
} else if (mimeData->hasHtml()) {
@@ -110,9 +115,9 @@ void WebAppClientService::initClipboardService() {
110115

111116
// React to clipboard changes
112117
connect(clipboard, &QClipboard::dataChanged, [this]() {
113-
// We need to store the clipboard ourselves to preserve external clipboard changes
118+
// We need to store the clipboard ourselves to preserve external clipboard changes we would
119+
// not catch otherwise
114120
keepClipboard();
115-
// sendClipboard();
116121
});
117122
}
118123

0 commit comments

Comments
 (0)