mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04: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:
parent
c511cb518c
commit
0aa029d548
1 changed files with 9 additions and 6 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue