mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-23 06:50:58 -04:00
Review fixes
This commit is contained in:
parent
dc7322cc4a
commit
806248ebd4
3 changed files with 26 additions and 10 deletions
|
@ -22,9 +22,6 @@
|
|||
#include <QTimer>
|
||||
|
||||
#include "core/Config.h"
|
||||
#ifdef Q_OS_MAC
|
||||
#include "core/MacPasteboard.h"
|
||||
#endif
|
||||
|
||||
Clipboard* Clipboard::m_instance(nullptr);
|
||||
|
||||
|
@ -33,16 +30,28 @@ Clipboard::Clipboard(QObject* parent)
|
|||
, m_timer(new QTimer(this))
|
||||
{
|
||||
m_timer->setSingleShot(true);
|
||||
#ifdef Q_OS_MAC
|
||||
m_pasteboard = new MacPasteboard;
|
||||
#endif
|
||||
|
||||
connect(m_timer, SIGNAL(timeout()), SLOT(clearClipboard()));
|
||||
connect(qApp, SIGNAL(aboutToQuit()), SLOT(clearCopiedText()));
|
||||
}
|
||||
|
||||
Clipboard::~Clipboard()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
if (m_pasteboard) {
|
||||
delete m_pasteboard;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Clipboard::setText(const QString& text)
|
||||
{
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
new MacPasteboard;
|
||||
QMimeData* mime = new QMimeData;
|
||||
mime->setText(text);
|
||||
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue