mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-08 22:42:34 -04:00
Add setting for search results timeout (#3411)
* Fix #3400 * Allow enabling/disabling search timeout * Allow setting search timeout in minutes
This commit is contained in:
parent
6ae27fa47b
commit
726dbc004d
4 changed files with 60 additions and 10 deletions
|
@ -116,8 +116,13 @@ bool SearchWidget::eventFilter(QObject* obj, QEvent* event)
|
|||
}
|
||||
}
|
||||
} else if (event->type() == QEvent::FocusOut) {
|
||||
// Auto-clear search after 5 minutes
|
||||
m_clearSearchTimer->start(300000);
|
||||
if (config()->get("security/clearsearch").toBool()) {
|
||||
int timeout = config()->get("security/clearsearchtimeout").toInt();
|
||||
if (timeout > 0) {
|
||||
// Auto-clear search after set timeout (5 minutes by default)
|
||||
m_clearSearchTimer->start(timeout * 60000); // 60 sec * 1000 ms
|
||||
}
|
||||
}
|
||||
} else if (event->type() == QEvent::FocusIn) {
|
||||
m_clearSearchTimer->stop();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue