summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2014-01-12 10:49:38 +0100
committerAndrea Diamantini <adjam7@gmail.com>2014-01-12 10:49:38 +0100
commit806c0ef272b847e8a40f9335661f7336e723d3c0 (patch)
tree5589ad5fa36c4bae4cb56675928a03f45d53d427 /src
parentrekonq 2.4.1 (diff)
downloadrekonq-806c0ef272b847e8a40f9335661f7336e723d3c0.tar.xz
Implement the "clear urlbar action"
You just need to add it (OUT of the urlbar) with right click --> configure main toolbar. Is this enough guys? PS: Thanks alouali for the idea ;) CCBUG: 243724
Diffstat (limited to 'src')
-rw-r--r--src/urlbar/urlbar.cpp8
-rw-r--r--src/urlbar/urlbar.h2
-rw-r--r--src/webwindow/webwindow.cpp6
3 files changed, 15 insertions, 1 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 274de8ab..2dca0ac0 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -888,3 +888,11 @@ void UrlBar::removeFromFavorites()
updateRightIcons();
}
}
+
+
+void UrlBar::clearUrlbar()
+{
+ clear();
+ clearRightIcons();
+ setFocus();
+}
diff --git a/src/urlbar/urlbar.h b/src/urlbar/urlbar.h
index 324e489b..67c2a9c6 100644
--- a/src/urlbar/urlbar.h
+++ b/src/urlbar/urlbar.h
@@ -97,6 +97,8 @@ public Q_SLOTS:
*/
void manageBookmarks();
+ void clearUrlbar();
+
private Q_SLOTS:
void loadRequestedUrl(const KUrl& url, Rekonq::OpenType = Rekonq::CurrentTab);
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index ee63e4d6..12ad0cad 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -199,6 +199,10 @@ void WebWindow::setupActions()
a->setDefaultWidget(_bar);
actionCollection()->addAction(QL1S("url_bar"), a);
+ a = new KAction(KIcon("edit-clear-locationbar-rtl"), i18n("Clear Urlbar"), this);
+ connect(a, SIGNAL(triggered()), _bar, SLOT(clearUrlbar()));
+ actionCollection()->addAction(QL1S("clear_url_bar"), a);
+
// load stop reload Action
m_loadStopReloadAction = new KAction(this);
actionCollection()->addAction(QL1S("load_stop_reload") , m_loadStopReloadAction);
@@ -293,7 +297,7 @@ void WebWindow::setupActions()
openLocationShortcut.setAlternate(Qt::ALT + Qt::Key_D);
a->setShortcut(openLocationShortcut);
actionCollection()->addAction(QL1S("open_location"), a);
- connect(a, SIGNAL(triggered(bool)) , this, SLOT(openLocation()));
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(openLocation()));
// User sessions management
a = new KAction(KIcon("view-choose"), i18n("&Manage Sessions"), this);