mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-03 10:00:04 -05:00
Set password hint on BSD, fill selection on macOS again (#8949)
This commit is contained in:
parent
3e3e87d3c5
commit
93831f64a3
@ -52,24 +52,19 @@ void Clipboard::setText(const QString& text, bool clear)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto* mime = new QMimeData;
|
auto* mime = new QMimeData;
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
mime->setText(text);
|
mime->setText(text);
|
||||||
|
#if defined(Q_OS_MACOS)
|
||||||
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
|
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
|
||||||
clipboard->setMimeData(mime, QClipboard::Clipboard);
|
#elif defined(Q_OS_UNIX)
|
||||||
#else
|
|
||||||
mime->setText(text);
|
|
||||||
#ifdef Q_OS_LINUX
|
|
||||||
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
|
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
|
||||||
#endif
|
#elif defined(Q_OS_WIN)
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
|
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
|
||||||
#endif
|
#endif
|
||||||
clipboard->setMimeData(mime, QClipboard::Clipboard);
|
|
||||||
|
|
||||||
if (clipboard->supportsSelection()) {
|
if (clipboard->supportsSelection()) {
|
||||||
clipboard->setMimeData(mime, QClipboard::Selection);
|
clipboard->setMimeData(mime, QClipboard::Selection);
|
||||||
}
|
}
|
||||||
#endif
|
clipboard->setMimeData(mime, QClipboard::Clipboard);
|
||||||
|
|
||||||
if (clear) {
|
if (clear) {
|
||||||
m_lastCopied = text;
|
m_lastCopied = text;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user