Clipboard sync on new connection
ClosedPublic

Authored by credman on Jul 20 2019, 2:35 PM.

Details

Summary

Added a timestamp to track clipboard changes, so when a new device connects it will sync the most recently updated clipboard to both devices.

Diff Detail

Repository
R224 KDE Connect
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
credman created this revision.Jul 20 2019, 2:35 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptJul 20 2019, 2:35 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
credman requested review of this revision.Jul 20 2019, 2:35 PM
credman updated this revision to Diff 62128.Jul 20 2019, 3:45 PM

Clipboard should not sync if the clipboard timestamp is unknown.

sredman added inline comments.
plugins/clipboard/clipboardlistener.h
40

Typically local variables are prefixed with m_<varname>, so like m_updateTimestamp. Of course, this should apply to currentContent as well...

61–62

Usually getters are just named <varname>, so like qint64 updateTimestamp()

plugins/clipboard/clipboardplugin.cpp
61

Space before {

64

} else { (Spaces)

credman updated this revision to Diff 62201.Jul 21 2019, 3:39 PM

Review changes to clipboard

credman updated this revision to Diff 62203.Jul 21 2019, 3:55 PM

Added definition for packet

credman marked 3 inline comments as done.Jul 21 2019, 6:14 PM
albertvaka added inline comments.
plugins/clipboard/clipboardplugin.cpp
65

This can be simplified with the other if branch.

This revision is now accepted and ready to land.Jul 21 2019, 6:28 PM
albertvaka added inline comments.Jul 21 2019, 10:18 PM
plugins/clipboard/clipboardplugin.cpp
40

As discussed, use a new packet type so this doesn't affect old apps. Also on Android.

credman updated this revision to Diff 62278.Jul 22 2019, 10:18 AM
  • Added new packet for initial connection sync
  • Added missing packet type changes
credman marked 3 inline comments as done.Jul 22 2019, 10:19 AM
This revision was automatically updated to reflect the committed changes.