From 9cdff6078e0e94349c684bd3b862fdea60d3f159 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Sun, 21 Feb 2010 22:07:49 +0100 Subject: Clean and optimize the findBar code. Use the searchString signal. Fix the selection of the lineEdit text when the findBar is reopen. --- src/mainwindow.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ef74adab..39dd9a40 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -777,22 +777,17 @@ void MainWindow::find(const QString & search) findNext(); } + void MainWindow::matchCaseUpdate() { if (!currentTab()) return; - QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; - - if (m_findBar->matchCase()) - options |= QWebPage::FindCaseSensitively; - currentTab()->view()->findText(m_lastSearch, QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument); - bool found = currentTab()->view()->findText(m_lastSearch, options); - m_findBar->notifyMatch(found); - if(!found) - currentTab()->view()->page()->focusNextPrevChild(true); + findNext(); } + + void MainWindow::findNext() { if (!currentTab()) @@ -819,12 +814,6 @@ void MainWindow::findPrevious() { if (!currentTab()) return; - - if(m_findBar->isHidden()) - { - currentTab()->view()->page()->focusNextPrevChild(true); - return; - } QWebPage::FindFlags options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) -- cgit v1.2.1