1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Properly fixed highlighting from d97ab52d8c

This commit is contained in:
nowrep 2012-07-27 21:23:41 +02:00
parent 45e43df849
commit c44e64814c

View File

@ -116,6 +116,10 @@ void SearchToolBar::caseSensitivityChanged()
void SearchToolBar::searchText(const QString &text) void SearchToolBar::searchText(const QString &text)
{ {
WebView* view = p_QupZilla->weView(); WebView* view = p_QupZilla->weView();
// Clear highlighting on page
view->findText(QString(), QWebPage::HighlightAllOccurrences);
bool found = view->findText(text, m_findFlags); bool found = view->findText(text, m_findFlags);
if (text.isEmpty()) { if (text.isEmpty()) {
@ -126,10 +130,6 @@ void SearchToolBar::searchText(const QString &text)
m_findFlags = QWebPage::HighlightAllOccurrences; m_findFlags = QWebPage::HighlightAllOccurrences;
updateFindFlags(); updateFindFlags();
view->findText(text, m_findFlags); view->findText(text, m_findFlags);
if (!found) {
view->findText(QString(), QWebPage::HighlightAllOccurrences);
}
} }
else { else {
view->findText(QString(), QWebPage::HighlightAllOccurrences); view->findText(QString(), QWebPage::HighlightAllOccurrences);