[Junior Job] Synchonize clipboard on device connection
Closed, ResolvedPublic

Description

Currently, the clipboard only synchronizes when it changes. This results in a problem when a device is connected but something already exists in the clipboard, since that does not get synchronized.

On device connect, the clipboards should somehow be synchonized. Very likely, both devices will already have something in the clipboard. This means that one or the other should be selected to be the "master" clipboard and be synchronized to the other, and that choice should be easily predictable by the user

  • This can't be as simple as "Desktop always trumps Android", because what if two desktop devices connect?
  • One nice solution might be that the newest clipboard contents take priority, but currently we do not keep track of when the clipboard was last changed

A good solution will likely require tweaks to both the Android and KDE apps

sredman created this task.Sep 15 2018, 7:09 PM
sredman triaged this task as Normal priority.
sredman renamed this task from Synchonize clipboard on device connection to [Junior Job] Synchonize clipboard on device connection.Sep 15 2018, 7:12 PM
hbalza claimed this task.Oct 5 2018, 5:09 AM
hbalza added a subscriber: hbalza.

I'd like to implement this one.

hbalza added a comment.Oct 5 2018, 7:28 AM

Alright, so i'm attempting to do the timestamp approach.

However i just noticed that (at least in KDE) the plugin only gets initialized when a device is connected, furthermore, it holds a separate instance for each device, so i can't really think of a way to hold a shared timestamp (at least within the clipboard plugin itself).

Any suggestions on how might this be done?

Welcome aboard!

You are correct that the plugin only gets constructed (on both Android and the desktop) when the devices are connected and that a new instance is created for every pairing

I have not looked in to this at all... The timestamp idea was my musing of how it might be solved. I was hoping that there was some clipboard library which would handle all of this messiness for us! This may be trickier than I first thought

If you have not already, feel welcome to join our Telegram group, which offers faster access to more knowledgeable people than me

Hi. I'd like to work on this one as well. But I'm new to KDE and also am a relative beginner in programming. I had a question - how should I start to dive into the code from on cgit. Thank you.

Hi. I'd like to work on this one as well. But I'm new to KDE and also am a relative beginner in programming. I had a question - how should I start to dive into the code from on cgit. Thank you.

Hi Kahnaasif. Sorry for the long delay, somehow I didn't see your message. This task is already completed. If you are still interested, the best way to browse our code is on our Gitlab, https://invent.kde.org/kde/kdeconnect-kde and https://invent.kde.org/kde/kdeconnect-android

This task has recently been completed but I would be happy to help you find another beginner task to work on. Feel free to join our IRC or Telegram (info here: https://community.kde.org/KDEConnect#Development) and talk with us about what you're interested in