Summary:
Fixed clearing the clipboard when clearing history
(bug #409366 caused by 3bd6ac34ed)
Properly synchronize clipboard content and history
(deleting last item in history didn't clear the clipboard).
Keep last image in history even if we are ignoring images, but without preview
(so that we can still clear history, and the tooltip says truth about clipboard content).
Fixed tray icon tooltip text.
Do not scale small images up in clipboard Plasmoid.
BUG: 409366
{F7168503}
Test Plan:
Spectacle -> [Copy to Clipboard]
Paste into Dolphin (clipboard content)
Deleting single items from clipboard
Clearing the entire history
Reviewers: #plasma, #plasma_workspaces, ngraham, davidedmundson
Reviewed By: #plasma, #plasma_workspaces, ngraham, davidedmundson
Subscribers: GB_2, davidre, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22684
This makes Klipper identify as org.kde.klipper to the notification service even when running inside of Plasma and installs a rule
to disable it from history by default.
BUG: 408989
FIXED-IN: 5.16.3
Differential Revision: https://phabricator.kde.org/D21963
Summary:
D19852 intrdouced x-kde-force-image-copy hint for programs to specify that
images should be set to the clipboard even if should not be included in the
history. But when the program was closed the clipboard was restored to the first
item in history in which the image was not included. To fix this introduce a new
class member which holds the last clipboard item and restore it.
Credit goes to David Edumndson
Test Plan:
Try it with spectacle
Reviewers:
@ngraham, @davidedmundson, #plasma
Subscribers:
Summary:
D19852 intrdouced x-kde-force-image-copy hint for programs to specify that
images should be set to the clipboard even if should not be included in the
history. But when the program was closed the clipboard was restored to the first
item in history in which the image was not included. To fix this introduce a new
class member which holds the last clipboard item and restore it.
Credit goes to David Edumndson
Test Plan:
Try it with spectacle
Reviewers:
@ngraham, @davidedmundson, #plasma
Subscribers:
Summary:
Change the default Klipper behavior in order for https://phabricator.kde.org/D19715 to work.
Klipper will save images to clipboard, but unless Ignore Images is unchecked in the options, it won't save them to clipboard history.
CCBUG: 393708
Reviewers: #plasma_workspaces, davidedmundson
Reviewed By: #plasma_workspaces, davidedmundson
Subscribers: ngraham, davidedmundson, plasma-devel, #plasma_workspaces
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D19852
Nested event loops in conjunction with QML are dangerous.
Port to QMessageBox which can be used without exec()
CHANGELOG: Fix crash when deactivating Klipper's URL grabber
BUG: 363771
FIXED-IN: 5.14.5
Differential Revision: https://phabricator.kde.org/D17531
Summary:
Password manager tools like Keepassx offer an option to clear
the clipboard/selection after some time, e.g. 10 seconds,
after the password was copied to the clipboard. This works fine,
but unfortunately the password isn't removed from Klipper's
history. This is a great security risk, which may make the use
of password managers impossible.
This patch changes Klipper::applyClipChanges(const QMimeData* clipData)
where clipboard data is inserted into history. If the data has an
additional mime type 'x-kde-passwordManagerHint' with the data 'secret',
it is not inserted into history.
For this to work as designed, password managers should add the
additional mime type 'x-kde-passwordManagerHint' to the mimeData
like following when copying a password to the clipboard:
```
QMimeData* mimeDataClipboard = new QMimeData();
const QString secretStr = "secret";
QByteArray secretBa = secretStr.toUtf8();
mimeDataClipboard->setText(password); // this is the password to copy
mimeDataClipboard->setData("x-kde-passwordManagerHint", secretBa);
clipboard->setMimeData(mimeDataClipboard, QClipboard::Clipboard);
if (clipboard->supportsSelection()) {
// we cannot use the same QMimeData, it's already owned by clipboard
QMimeData* mimeDataSelection = new QMimeData();
mimeDataSelection->setText(password); // this is the password to
copy
mimeDataSelection->setData("x-kde-passwordManagerHint", secretBa);
clipboard->setMimeData(mimeDataSelection, QClipboard::Selection);
}
```
Reviewers: davidedmundson
Reviewed By: davidedmundson
Subscribers: dvratil, broulik, graesslin, davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D12539
Summary:
Password manager tools like Keepassx offer an option to clear
the clipboard/selection after some time, e.g. 10 seconds,
after the password was copied to the clipboard. This works fine,
but unfortunately the password isn't removed from Klipper's
history. This is a great security risk, which may make the use
of password managers impossible.
This patch changes Klipper::applyClipChanges(const QMimeData* clipData)
where clipboard data is inserted into history. If the data has an
additional mime type 'x-kde-passwordManagerHint' with the data 'secret',
it is not inserted into history.
For this to work as designed, password managers should add the
additional mime type 'x-kde-passwordManagerHint' to the mimeData
like following when copying a password to the clipboard:
```
QMimeData* mimeDataClipboard = new QMimeData();
const QString secretStr = "secret";
QByteArray secretBa = secretStr.toUtf8();
mimeDataClipboard->setText(password); // this is the password to copy
mimeDataClipboard->setData("x-kde-passwordManagerHint", secretBa);
clipboard->setMimeData(mimeDataClipboard, QClipboard::Clipboard);
if (clipboard->supportsSelection()) {
// we cannot use the same QMimeData, it's already owned by clipboard
QMimeData* mimeDataSelection = new QMimeData();
mimeDataSelection->setText(password); // this is the password to
copy
mimeDataSelection->setData("x-kde-passwordManagerHint", secretBa);
clipboard->setMimeData(mimeDataSelection, QClipboard::Selection);
}
```
Reviewers: davidedmundson
Reviewed By: davidedmundson
Subscribers: dvratil, broulik, graesslin, davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D12539
Newer libprison might give nullpointers depending on compilation
options. Adapt code to be able to handle that.
Differential Revision: https://phabricator.kde.org/D10628
Summary:
There's no reason to have different behaviour depending on whether the
UI is presented in an applet or not.
Test Plan: Looked in qdbusviewer
Reviewers: #plasma
Subscribers: graesslin, heikobecker, broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7536
Without this, that wasn't always the case if the top item was only the mouse
selection. This was presumably broken by 2e47d84772.
Also explicitly check the popup item, since it's now owned by Klipper.
BUG: 348390
BUG: 251222
Without this, that wasn't always the case if the top item was only the mouse
selection. This was presumably broken by 2e47d84772.
Also explicitly check the popup item, since it's now owned by Klipper.
BUG: 348390
BUG: 251222
Without this, that wasn't always the case if the top item was only the mouse
selection. This was presumably broken by 2e47d84772.
Also explicitly check the popup item, since it's now owned by Klipper.
BUG: 348390
BUG: 251222
Summary:
EditAction is a keyboard activated shortcut that shows a dialog, there's
no reason for it to be available in standalone mode only, especially given the
option to enable the shortcut is available from the plasmoid.
BUG: 374961
Test Plan:
Set shortcut.
Pressed it.
Got a dialog with my clipboard contents
Standalone mode should be unchanged as it was showing it already.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4114
Summary:
Klipper shows a notification when the shortcuts next/prev history item
gets triggered. This notification used to be implemented in the class
KlipperTray. With the switch from SNI based clipper to a Plasmoid the
notification got lost as the Plasmoid doesn't use the KlipperTray class
at all.
This change moves the notification handling from KlipperTray to Klipper
so that it gets emitted for both SNI and Plasmoid based klipper.
BUG: 368808
FIXED-IN: 5.8.1
Test Plan: Set the shortcuts, triggered them and verified the notification gets shown.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2942
Summary:
Reduces code duplication and we always opperate on cached value, that
is the platform is only checked once in application life cycle.
Reviewers: #plasma, hein
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2342
Some actions were set to not-visible in order to not show them in
the popup if not in standalone mode. This has the side effect of
global shortcuts no longer working as global shortcuts do not
trigger for not visible actions.
To fullfill both needs the check is now done to only add the actions
to the popup if it's in standalone mode, but the visibility is not
changed.
BUG: 345945
FIXED-IN: 5.3.1
REVIEW: 123727
By invoking saveHistory after each change we ensure that the clipboard
doesn't lose data in case klipper (or in dataengine mode plasmashell)
crashes.
To not cause stalls, the saving is performed in a thread using
QtConcurrentRun. As klipper itself is not thread save a Mutex is
used to lock changes in the HistoryModel.
To not overload the system the save operations are delayed and queued.
Each save is delayed by five seconds since the last clipboard change.
So if the clipboard is changed multiple times in a short interval it
doesn't get synced to the disk till the interaction has settled.
BUG: 343333
FIXED-IN: 5.3.0
REVIEW: 122382
As Prison no longer provides a QWidget based API, we need to do the
mapping to a QWidget ourself.
Note: for the plasmoid I'm considering switching to a non-widget based
solution.
REVIEW: 122386
We don't want to show e.g. the Quit button in the popup dialog when
Klipper is part of plasmashell. It would quit plasma. Not the best idea.
The menu now only shows the history items , all other options should be
used from the UI.
The ClipboardJob does no longer set the result directly when editing
is invoked, but instead connects to a new signal emitted from Klipper.
As soon as editing finished the result gets emitted.
This is useful to block the UI for further editing while an entry
gets edited.
Klipper class needs to be splitted in a better way, but as a first step
just disable parts based on mode. E.g. we don't want to export the
klipper dbus interface when executed as a data engine.
The slot to show barcode for top most item is turned into a method
taking the history item. The connection is changed to a lambda slot
passing the first item to this new method.
The slot is turned into a method taking a HistoryItem. The connect is
replaced by a variant using a lambda which delegates to the changed
method with the top item as argument.
History doesn't use the KlipperPopup at all, it just creates it and
provides it through the ::popup() method. This can also be done by
Klipper directly turning History in a data only class.