From ae44181e5ee8c3b75e9672146e89c92a7b7da5a2 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 16 Dec 2007 19:25:59 +0000 Subject: [PATCH] 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 --- src/dolphinmainwindow.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 46a80629b6..ea240ba83c 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()