mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Clear clipboard on database lock
- Always store the last copied text - clearCopiedText will always clear clipboard regardless of timer state
This commit is contained in:
committed by
Jonathan White
parent
c511cb518c
commit
0aa029d548
@@ -67,21 +67,24 @@ void Clipboard::setText(const QString& text, bool clear)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (clear && config()->get(Config::Security_ClearClipboard).toBool()) {
|
if (clear) {
|
||||||
|
m_lastCopied = text;
|
||||||
|
if (config()->get(Config::Security_ClearClipboard).toBool()) {
|
||||||
int timeout = config()->get(Config::Security_ClearClipboardTimeout).toInt();
|
int timeout = config()->get(Config::Security_ClearClipboardTimeout).toInt();
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
m_lastCopied = text;
|
|
||||||
m_timer->start(timeout * 1000);
|
m_timer->start(timeout * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clipboard::clearCopiedText()
|
void Clipboard::clearCopiedText()
|
||||||
{
|
{
|
||||||
if (m_timer->isActive()) {
|
if (m_timer->isActive()) {
|
||||||
m_timer->stop();
|
m_timer->stop();
|
||||||
clearClipboard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearClipboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clipboard::clearClipboard()
|
void Clipboard::clearClipboard()
|
||||||
|
|||||||
Reference in New Issue
Block a user