mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-23 06:50:58 -04:00
Do not delete MacPasteboard instance on exit, resolves #1543
This commit is contained in:
parent
199f0932bf
commit
ee8499f65c
3 changed files with 14 additions and 5 deletions
|
@ -24,14 +24,19 @@
|
|||
#include "core/Config.h"
|
||||
|
||||
Clipboard* Clipboard::m_instance(nullptr);
|
||||
#ifdef Q_OS_MAC
|
||||
QPointer<MacPasteboard> Clipboard::m_pasteboard(nullptr);
|
||||
#endif
|
||||
|
||||
Clipboard::Clipboard(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_timer(new QTimer(this))
|
||||
#ifdef Q_OS_MAC
|
||||
, m_pasteboard(new MacPasteboard)
|
||||
#endif
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
if (!m_pasteboard) {
|
||||
m_pasteboard = new MacPasteboard();
|
||||
}
|
||||
#endif
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, SIGNAL(timeout()), SLOT(clearClipboard()));
|
||||
connect(qApp, SIGNAL(aboutToQuit()), SLOT(clearCopiedText()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue