mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
parent
236edae60b
commit
f236c32063
@ -31,7 +31,7 @@ Clipboard::Clipboard(QObject* parent)
|
||||
{
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, SIGNAL(timeout()), SLOT(clearClipboard()));
|
||||
connect(qApp, SIGNAL(aboutToQuit()), SLOT(cleanup()));
|
||||
connect(qApp, SIGNAL(aboutToQuit()), SLOT(clearCopiedText()));
|
||||
}
|
||||
|
||||
void Clipboard::setText(const QString& text)
|
||||
@ -52,6 +52,14 @@ void Clipboard::setText(const QString& text)
|
||||
}
|
||||
}
|
||||
|
||||
void Clipboard::clearCopiedText()
|
||||
{
|
||||
if (m_timer->isActive()) {
|
||||
m_timer->stop();
|
||||
clearClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
void Clipboard::clearClipboard()
|
||||
{
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
@ -73,14 +81,6 @@ void Clipboard::clearClipboard()
|
||||
m_lastCopied.clear();
|
||||
}
|
||||
|
||||
void Clipboard::cleanup()
|
||||
{
|
||||
if (m_timer->isActive()) {
|
||||
m_timer->stop();
|
||||
clearClipboard();
|
||||
}
|
||||
}
|
||||
|
||||
Clipboard* Clipboard::instance()
|
||||
{
|
||||
if (!m_instance) {
|
||||
|
@ -33,9 +33,11 @@ public:
|
||||
|
||||
static Clipboard* instance();
|
||||
|
||||
public Q_SLOTS:
|
||||
void clearCopiedText();
|
||||
|
||||
private Q_SLOTS:
|
||||
void clearClipboard();
|
||||
void cleanup();
|
||||
|
||||
private:
|
||||
explicit Clipboard(QObject* parent = Q_NULLPTR);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "core/Metadata.h"
|
||||
#include "core/qsavefile.h"
|
||||
#include "format/CsvExporter.h"
|
||||
#include "gui/Clipboard.h"
|
||||
#include "gui/DatabaseWidget.h"
|
||||
#include "gui/DatabaseWidgetStateSync.h"
|
||||
#include "gui/DragTabBar.h"
|
||||
@ -632,6 +633,8 @@ bool DatabaseTabWidget::hasLockableDatabases() const
|
||||
|
||||
void DatabaseTabWidget::lockDatabases()
|
||||
{
|
||||
clipboard()->clearCopiedText();
|
||||
|
||||
for (int i = 0; i < count(); i++) {
|
||||
DatabaseWidget* dbWidget = static_cast<DatabaseWidget*>(widget(i));
|
||||
Database* db = databaseFromDatabaseWidget(dbWidget);
|
||||
|
Loading…
Reference in New Issue
Block a user