diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/findbar.cpp | 2 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 17 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | 
3 files changed, 18 insertions, 2 deletions
| diff --git a/src/findbar.cpp b/src/findbar.cpp index 2b464978..6b92f130 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -92,7 +92,7 @@ FindBar::FindBar(KMainWindow *mainwindow)      // Case sensitivity. Deliberately set so this is off by default.      m_matchCase->setCheckState(Qt::Unchecked);      m_matchCase->setTristate(false); -    connect(m_matchCase, SIGNAL(toggled(bool)), mainwindow, SLOT(findNext())); +    connect(m_matchCase, SIGNAL(toggled(bool)), mainwindow, SLOT(matchCaseUpdate()));      layout->addWidget(m_matchCase);      // stretching widget on the left diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 22cf8c6c..d61b56f9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -777,7 +777,22 @@ 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); +}  void MainWindow::findNext()  {      if (!currentTab()) diff --git a/src/mainwindow.h b/src/mainwindow.h index c104ad4d..db75b1bd 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -127,6 +127,7 @@ private slots:      // Find Action slots      void find(const QString &); +    void matchCaseUpdate();      void findNext();      void findPrevious(); | 
