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:
ServiceJob::setResult already does a emitResult.
Discovered with the assert created in https://phabricator.kde.org/D9862
Reviewers: #frameworks, #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10629
ECM, when requiring ECM >=5.38, sets CMAKE_*_OUTPUT_DIRECTORY, so the
tests executables are no longer generated in the current binary dir.
Calling add_test() with the signature
add_test(<name> <command> [...])
will not result in any further processing of the <command> argument,
it will be executed as is. Using instead
add_test(NAME <name> COMMAND <command> [...])
will result in <command> getting some handling, cmp. CMake docs:
"If <command> specifies an executable target (created by add_executable())
it will automatically be replaced by the location of the executable
created at build time."
Which is what is needed now here (and also used in ecm_add_test).
remove invalid and superfluous markup <qt> + </qt> in kcfg file
add TranslationSystem=kde in kcfgc file to generate i18n() calls at build time for these tooltips
using the catalog klipper defined with setApplicationDomain
Differential Revision: https://phabricator.kde.org/D8453
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
Fails to build with undefined reference to
bool QTest::qCompare<int, unsigned int>(int const&, unsigned int const&, char const*, char const*, char const*, int)'
error.
This has been fixed in 2f22f0a935 for 5.10 branch but not 5.8
Differential Revision: https://phabricator.kde.org/D6874
Launching .desktop files using KProcess skips handling that should be done
when launching apps. E.g. opening an URL with Firefox will make the new window
open in background if Firefox is already running, because startup notification
hasn't been handled at all. And KProcess is useless in this case anyway,
as Klipper doesn't care about stdout of Firefox.
Summary:
37014e643c introduced a change in the
behaviour of what happens when you select the top entry in the list.
Change makes some sense. Unit test was not updated, it therefore failed.
Test Plan: Ran unit test
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: joselema, rikmills, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5570
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