summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-02-20 14:40:46 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-02-20 14:40:46 +0100
commita275a256f08fb28faf64341342b5162bb9a9c634 (patch)
treee0edb61b9cf2570a4a7b4d067a936628576ed846 /src/mainwindow.cpp
parentwindow title fixes (diff)
parentGet rid of the selection of the next found expression when the checkbox match... (diff)
downloadrekonq-a275a256f08fb28faf64341342b5162bb9a9c634.tar.xz
Merge commit 'refs/merge-requests/92' of git://gitorious.org/rekonq/mainline into mr92
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f9143a18..ef74adab 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -773,33 +773,67 @@ void MainWindow::find(const QString & search)
if (!currentTab())
return;
m_lastSearch = 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() && m_lastSearch.isEmpty())
+ if (!currentTab())
return;
+ if(m_findBar->isHidden())
+ {
+ currentTab()->view()->page()->focusNextPrevChild(true);
+ return;
+ }
+
QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument;
if (m_findBar->matchCase())
options |= QWebPage::FindCaseSensitively;
- m_findBar->notifyMatch(currentTab()->view()->findText(m_lastSearch, options));
+ bool found = currentTab()->view()->findText(m_lastSearch, options);
+ m_findBar->notifyMatch(found);
+ if(!found)
+ currentTab()->view()->page()->focusNextPrevChild(true);
}
void MainWindow::findPrevious()
{
- if (!currentTab() && m_lastSearch.isEmpty())
+ if (!currentTab())
return;
+ if(m_findBar->isHidden())
+ {
+ currentTab()->view()->page()->focusNextPrevChild(true);
+ return;
+ }
+
QWebPage::FindFlags options = QWebPage::FindBackward | QWebPage::FindWrapsAroundDocument;
if (m_findBar->matchCase())
options |= QWebPage::FindCaseSensitively;
- m_findBar->notifyMatch(currentTab()->view()->findText(m_lastSearch, options));
+ bool found = currentTab()->view()->findText(m_lastSearch, options);
+ m_findBar->notifyMatch(found);
+ if(!found)
+ currentTab()->view()->page()->focusNextPrevChild(true);
}