From: Peter Penz Date: Sun, 16 Dec 2007 19:25:59 +0000 (+0000) Subject: If the URL navigator is editable and has the focus, Ctrl+A should select the URL... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/ae44181e5ee8c3b75e9672146e89c92a7b7da5a2 If the URL navigator is editable and has the focus, Ctrl+A should select the URL and not all items (thanks to Morton O. Hansen for the patch!) BUG: 153697 svn path=/trunk/KDE/kdebase/apps/; revision=749188 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 46a80629b..ea240ba83 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -69,11 +69,13 @@ #include #include #include +#include -#include -#include -#include -#include +#include +#include +#include +#include +#include DolphinMainWindow::DolphinMainWindow(int id) : KXmlGuiWindow(0), @@ -559,7 +561,19 @@ void DolphinMainWindow::updatePasteAction() void DolphinMainWindow::selectAll() { clearStatusBar(); - m_activeViewContainer->view()->selectAll(); + + // if the URL navigator is editable and focused, select the whole + // URL instead of all items of the view + + KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator(); + QLineEdit* lineEdit = urlNavigator->editor()->lineEdit(); + const bool selectUrl = urlNavigator->isUrlEditable() && + lineEdit->hasFocus(); + if (selectUrl) { + lineEdit->selectAll(); + } else { + m_activeViewContainer->view()->selectAll(); + } } void DolphinMainWindow::invertSelection()