mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
SearchToolBar: Ignore old search callbacks
BUG: 401343 FIXED-IN: 3.1.0
This commit is contained in:
parent
9e7011cbed
commit
51eb65ecec
@ -120,11 +120,15 @@ void SearchToolBar::setText(const QString &text)
|
||||
|
||||
void SearchToolBar::searchText(const QString &text)
|
||||
{
|
||||
m_searchRequests++;
|
||||
QPointer<SearchToolBar> guard = this;
|
||||
m_view->findText(text, m_findFlags, [=](bool found) {
|
||||
if (!guard) {
|
||||
return;
|
||||
}
|
||||
if (--m_searchRequests != 0) {
|
||||
return;
|
||||
}
|
||||
if (ui->lineEdit->text().isEmpty())
|
||||
found = true;
|
||||
|
||||
|
@ -60,6 +60,7 @@ private:
|
||||
WebView* m_view;
|
||||
|
||||
QWebEnginePage::FindFlags m_findFlags;
|
||||
int m_searchRequests = 0;
|
||||
};
|
||||
|
||||
#endif // SEARCHTOOLBAR_H
|
||||
|
Loading…
Reference in New Issue
Block a user