From 7a93d8a59aa0f693ae533a35b0bc3e4607d3f5ff Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 9 Apr 2009 19:03:50 +0200 Subject: Refactoring find bar following (a bit) Pawel suggestions.. Applied match Case search --- src/mainwindow.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c074d667..2d959034 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -566,7 +566,18 @@ void MainWindow::slotFindNext() { if (!currentTab() && m_lastSearch.isEmpty()) return; - if (!currentTab()->findText(m_lastSearch, QWebPage::FindWrapsAroundDocument)) + + QWebPage::FindFlags options; + if(m_findBar->matchCase()) + { + options = QWebPage::FindCaseSensitively | QWebPage::FindWrapsAroundDocument; + } + else + { + options = QWebPage::FindWrapsAroundDocument; + } + + if (!currentTab()->findText(m_lastSearch, options)) { slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); } @@ -577,7 +588,18 @@ void MainWindow::slotFindPrevious() { if (!currentTab() && m_lastSearch.isEmpty()) return; - if (!currentTab()->findText(m_lastSearch, QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument)) + + QWebPage::FindFlags options; + if(m_findBar->matchCase()) + { + options = QWebPage::FindCaseSensitively | QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; + } + else + { + options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument; + } + + if (!currentTab()->findText(m_lastSearch, options)) { slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); } -- cgit v1.2.1