mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +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)
|
void SearchToolBar::searchText(const QString &text)
|
||||||
{
|
{
|
||||||
|
m_searchRequests++;
|
||||||
QPointer<SearchToolBar> guard = this;
|
QPointer<SearchToolBar> guard = this;
|
||||||
m_view->findText(text, m_findFlags, [=](bool found) {
|
m_view->findText(text, m_findFlags, [=](bool found) {
|
||||||
if (!guard) {
|
if (!guard) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (--m_searchRequests != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ui->lineEdit->text().isEmpty())
|
if (ui->lineEdit->text().isEmpty())
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ private:
|
|||||||
WebView* m_view;
|
WebView* m_view;
|
||||||
|
|
||||||
QWebEnginePage::FindFlags m_findFlags;
|
QWebEnginePage::FindFlags m_findFlags;
|
||||||
|
int m_searchRequests = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SEARCHTOOLBAR_H
|
#endif // SEARCHTOOLBAR_H
|
||||||
|
Loading…
Reference in New Issue
Block a user