This commit turns on "Ignore selection" by default, copy selected
text by default is generally not expected and make the clipboard
history seems "random".
You can still paste selected text with the mouse middle click.
This commit increases the default clipboard size from 7 to 20, that
way it could be more useful, allowing user to recover older
clipboard contents by default.
select() is not safe, it can corrupt stack if the polled fd is greater
than FD_SETSIZE. poll() is a much safer alternative. Unlike 20 or so
years ago, many unix systems support poll() nowadays, so we can safely
use it.
Previously the "clear clipboard history?" dialog used `KMessageBox::questionYesNo`
which if "don't ask again" is ticked then saves the answer even if No was answered.
This can cause the user to not be able to ever clear the clipboard ever again. This
commit changes it to `KMessageBox::warningContinueCancel` which doesn't do that, and
is more appropriate for the kind of question we're asking.
BUG: 336053
FIXED-IN: 5.22
This is a mind-blowingly amazing feature, but nobody knows about it
because it's disabled by default since it has no default shortcut, and
there is no visible UI to tell you about it except for the shortcut
configuration view buried in Klipper's settings window.
A similar feature was just recently introduced in Microsoft Windows, and
users have started to ask why no equivalent KDE feature exists, because
they are unaware that it already does! The shortcut Microsoft chose is
Meta+V, which is a completely sensible one. If we set the same shortcut
for the Klipper feature, discoverability is automatically increased
because users familiar with Windows are already becoming accustomed to the
Meta+V shortcut. This is not an argument for deliberately copying
another platform, but rather making use of the user familiarity that
they have helpfully done the hard work of creating for us. Meta+V is
unused and is an appropriate shell-level global shortcut by virtue of
using the Meta key. So let's bind it to this Klipper feature by default.
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
7bd9bea072 started using Prison
unconditionally via QML import. So if Prison isn't installed the
clipboard applet stops working, complaining that "org.kde.prison is
not installed".
While it would certainly be possible to add another call to
"find_package(KF5Prison)" with TYPE RUNTIME, the result in
feature_summary would be very confusing, because OPTIONAL has a higher
priority and the runtime hint would vanish if you build with e.g.
-DCMAKE_DISABLE_FIND_PACKAGE_KF5Prison=TRUE.