From 12c239ae149cfed254066248f411b114743f5836 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 26 Apr 2012 08:31:46 +0200 Subject: Update the view when changing the directory using 'cd' in the terminal Thanks to Jekyll Wu for helping to implement this feature! FEATURE: 156732 FIXED-IN: 4.9.0 --- src/dolphinviewcontainer.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 22be3a833..5f8b8f3b4 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -45,7 +45,6 @@ #include #include "dolphin_generalsettings.h" -#include "dolphinmainwindow.h" #include "filterbar/filterbar.h" #include "search/dolphinsearchbox.h" #include "statusbar/dolphinstatusbar.h" @@ -64,7 +63,8 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) : m_filterBar(0), m_statusBar(0), m_statusBarTimer(0), - m_statusBarTimestamp() + m_statusBarTimestamp(), + m_autoGrabFocus(true) { hide(); @@ -180,6 +180,16 @@ bool DolphinViewContainer::isActive() const return m_view->isActive(); } +void DolphinViewContainer::setAutoGrabFocus(bool grab) +{ + m_autoGrabFocus = grab; +} + +bool DolphinViewContainer::autoGrabFocus() const +{ + return m_autoGrabFocus; +} + const DolphinStatusBar* DolphinViewContainer::statusBar() const { return m_statusBar; @@ -496,7 +506,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url) setSearchModeEnabled(isSearchUrl(url)); m_view->setUrl(url); - if (isActive() && !isSearchUrl(url)) { + if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) { // When an URL has been entered, the view should get the focus. // The focus must be requested asynchronously, as changing the URL might create // a new view widget. -- cgit v1.3