From 67138dcf8e3a1788928fd31256b29a257dae5eee Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Sun, 22 Aug 2010 04:06:54 +0200 Subject: Use the selected text as the default search string of the FindBar The common behavior of the Find action is to start a search with the current selected text if any. This patch implement this behavior for Rekonq. --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5eb43aa0..44cc6d59 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -907,6 +907,15 @@ void MainWindow::setWidgetsVisible(bool makeVisible) } +QString MainWindow::selectedText() const +{ + if (!currentTab()) + return QString(); + + return currentTab()->view()->selectedText(); +} + + void MainWindow::viewPageSource() { if (!currentTab()) -- cgit v1.2.1