Set password hint on BSD, fill selection on macOS again (#8949)

This commit is contained in:
Klemens Nanni 2023-01-29 18:17:04 +04:00 committed by Jonathan White
parent 605f13ed4a
commit 32f2710430
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -52,24 +52,19 @@ void Clipboard::setText(const QString& text, bool clear)
}
auto* mime = new QMimeData;
#ifdef Q_OS_MACOS
mime->setText(text);
#if defined(Q_OS_MACOS)
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
clipboard->setMimeData(mime, QClipboard::Clipboard);
#else
mime->setText(text);
#ifdef Q_OS_LINUX
#elif defined(Q_OS_UNIX)
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
#endif
#ifdef Q_OS_WIN
#elif defined(Q_OS_WIN)
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
#endif
clipboard->setMimeData(mime, QClipboard::Clipboard);
if (clipboard->supportsSelection()) {
clipboard->setMimeData(mime, QClipboard::Selection);
}
#endif
clipboard->setMimeData(mime, QClipboard::Clipboard);
if (clear) {
m_lastCopied = text;