From 83c667187cd4232c412f6390c4ba33a13c328c5a Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Thu, 2 Sep 2010 22:03:47 +0200 Subject: - Follow pano's suggestion : Shift + Enter -> findPrevious() - Don't call findNext() if Ctrl + F is pressed with an existing selection - Correctly update highlights with the timer - A little cleanup --- src/mainwindow.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 11580f69..92735f6f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -370,8 +370,6 @@ void MainWindow::setupActions() KShortcut findShortcut = KStandardShortcut::find(); findShortcut.setAlternate(Qt::Key_Slash); a->setShortcut(findShortcut); - a->setChecked(m_findBar->isVisible()); - connect(m_findBar, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); KStandardAction::findNext(this, SLOT(findNext()) , actionCollection()); KStandardAction::findPrev(this, SLOT(findPrevious()) , actionCollection()); @@ -781,6 +779,7 @@ void MainWindow::find(const QString & search) return; m_lastSearch = search; + updateHighlight(); findNext(); } @@ -792,6 +791,7 @@ void MainWindow::matchCaseUpdate() currentTab()->view()->findText(m_lastSearch, QWebPage::FindBackward); findNext(); + updateHighlight(); } @@ -800,8 +800,6 @@ void MainWindow::findNext() if (!currentTab()) return; - highlightAll(); - if (m_findBar->isHidden()) { QPoint previous_position = currentTab()->view()->page()->currentFrame()->scrollPosition(); @@ -810,8 +808,6 @@ void MainWindow::findNext() return; } - highlightAll(); - QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; if (m_findBar->matchCase()) options |= QWebPage::FindCaseSensitively; @@ -841,7 +837,8 @@ void MainWindow::findPrevious() m_findBar->notifyMatch(found); } -void MainWindow::highlightAll() + +void MainWindow::updateHighlight() { if (!currentTab()) return; -- cgit v1.2.1