mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Reduce delay when searching entries in Auto-Type select dialog
* Fix #7596
This commit is contained in:
parent
7dc2d236df
commit
4178e72fe0
@ -62,7 +62,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
|
||||
|
||||
m_ui->search->installEventFilter(this);
|
||||
|
||||
m_searchTimer.setInterval(300);
|
||||
m_searchTimer.setInterval(0);
|
||||
m_searchTimer.setSingleShot(true);
|
||||
|
||||
connect(m_ui->search, SIGNAL(textChanged(QString)), &m_searchTimer, SLOT(start()));
|
||||
@ -71,7 +71,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
|
||||
|
||||
m_ui->searchCheckBox->setShortcut(Qt::CTRL + Qt::Key_F);
|
||||
connect(m_ui->searchCheckBox, &QCheckBox::toggled, this, [this](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
setDelayedSearch(checked);
|
||||
performSearch();
|
||||
});
|
||||
|
||||
@ -107,6 +107,7 @@ void AutoTypeSelectDialog::setMatches(const QList<AutoTypeMatch>& matches,
|
||||
|
||||
// always perform search when updating matches to refresh view
|
||||
performSearch();
|
||||
setDelayedSearch(noMatches);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::setSearchString(const QString& search)
|
||||
@ -115,6 +116,11 @@ void AutoTypeSelectDialog::setSearchString(const QString& search)
|
||||
m_ui->searchCheckBox->setChecked(true);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::setDelayedSearch(bool state)
|
||||
{
|
||||
m_searchTimer.setInterval(state ? 150 : 0);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::submitAutoTypeMatch(AutoTypeMatch match)
|
||||
{
|
||||
if (match.first) {
|
||||
|
@ -60,6 +60,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void buildActionMenu();
|
||||
void setDelayedSearch(bool state);
|
||||
|
||||
QScopedPointer<Ui::AutoTypeSelectDialog> m_ui;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user