If you lock the screen in EndeavourOS, a signal KSystemClipboard:changed is emitted with empty text and clipboard mode QClipboard::Clipboard. Upon unlock the clipboard will be re-synced.
A clipboard network packet will be sent for KSystemClipboard::changed signals if:
1. the received mode is QClipboard::Clipboard
2. the new content and its type are different from the current ones.
The problem here is that, before locking the screen, current content is not empty. As of condition #2, a network packet with the empty text will be sent, which clears the current clipboard selection in GBoard but the contents stay the same. Upon re-sync in unlock, a packet will be sent again due to #2.
This commit aims to fix this by ignoring empty text updates since from the end-user it unnecessarily clears the current clipboard selection and results in many "Copied to clipboard" toasts.
This is far less code and allows for an easier enforcing of standards, for
example the name of the log identifiers which were adjusted in a few cases.
Also clean up unused includes when noticed.
- We do not need the return type. If a plugin declares it can handle the
packet it should do so. We don't have any fallback logic in place and
the packet types are namespaced with the plugin IDs anyway.
- Provide a default implementation with a warning, not all plugins need
to overwrite this
The rationale is explained in https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/
In case of KDEConnect, it impressively speeds up compilation. Before it
took 390 seconds on a clean build and with this change it took 330 seconds.
This is due to the mocs_compilation having to include the header files
and thus all their headers. Due to the lots of small plugins we have,
this means that the same headers must be compiled plenty of times.
When we include the moc files directly in the C++ file, they are already
available.
By removing the postfix we consistently use, we get exactly the same string as before
However, all our pluginId logic is now done as part of the buildsystem.
Before, they were in the JSON metadata, the buildsystem and the string constructor parameter
KPluginFactory has the KPluginMetaData object in any case, do using it
doesn't create any overhead.
This way we catch missing methods/mismatching arguments at compile and
not at runtime.
This fixes some Qt6 regressions due to the removal of deprecated methods.
We do not need those methods to be marked as slots and the KCMUtils
classes like KPluginWidget also don't need it.
Meaning it just results in more moc code being generated.
This makes it easier to read, because we do not have to handle a list of
files that get added to the targets. In other KDE projects, we also
prefer the target centric approach.
In case one wants to reuse the same category in multiple places, it
would be best to create a small static lib. But for now, this is not
needed.
The one derived from the filename is identical. Deriving it from the filename is the preferred approach.
In KF6, log messages are printed out if the Id is needlessly specified.
A mismatching Id vs basename would print out a warning.
The plugin version doesn't matter, because all plugins are shipped as
part of kdeconnect and not separately.
The website was also set inconsistently, some pointed to a custom blog,
the KDE homepage or a broken link. If we want to make announcements more
visible, we should have a link in a more central place.
Continues the work started in !396 by rebasing it onto latest master and
making the "send clipboard" button from the plasmoid invisible when
automatic syncing is enabled.
I didn't find a way to do the same in kdeconnect-indicator and
kdeconnect-app (why do we have 3 UIs???), so in those we always show the
option for now.