mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-23 06:50:58 -04:00
Change MacPasteboard init object to QScopedPointer
This commit is contained in:
parent
806248ebd4
commit
afe48da4b1
2 changed files with 4 additions and 15 deletions
|
@ -28,25 +28,15 @@ Clipboard* Clipboard::m_instance(nullptr);
|
|||
Clipboard::Clipboard(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_timer(new QTimer(this))
|
||||
#ifdef Q_OS_MAC
|
||||
, m_pasteboard(new MacPasteboard)
|
||||
#endif
|
||||
{
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue