diff options
| author | Peter Penz <[email protected]> | 2007-12-16 19:25:59 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-12-16 19:25:59 +0000 |
| commit | ae44181e5ee8c3b75e9672146e89c92a7b7da5a2 (patch) | |
| tree | fe5d584d63de9a0c72bcf2f70721a707d52e7896 /src | |
| parent | 242b88396f6ba66e0bf7f72e98e07ed50b7b2c09 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
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 <kstatusbar.h> #include <kstandardaction.h> #include <kurl.h> +#include <kurlcombobox.h> -#include <QtGui/QKeyEvent> -#include <QtGui/QClipboard> -#include <QtGui/QSplitter> -#include <QtGui/QDockWidget> +#include <QKeyEvent> +#include <QClipboard> +#include <QLineEdit> +#include <QSplitter> +#include <QDockWidget> 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() |
