From 79a7412107551cdb175d3399561478b9434a2766 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 1 Jan 2011 17:54:23 +0000 Subject: [PATCH] Forward port: Don't grab the focus if the view did not have the focus already. CCBUG: 261147 FIXED-IN: 4.6.0 svn path=/trunk/KDE/kdebase/apps/; revision=1210659 --- src/views/dolphindetailsview.cpp | 3 --- src/views/dolphiniconsview.cpp | 3 --- src/views/dolphinview.cpp | 14 ++++++++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/views/dolphindetailsview.cpp b/src/views/dolphindetailsview.cpp index dcde4b496..12a2ba348 100644 --- a/src/views/dolphindetailsview.cpp +++ b/src/views/dolphindetailsview.cpp @@ -158,9 +158,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, KDirLister *dirLister = qobject_cast(proxyModel->sourceModel())->dirLister(); connect(dirLister, SIGNAL(newItems(KFileItemList)), this, SLOT(resizeColumns())); - - // setFocus() must be called after m_extensionsFactory is initialised (see bug 240374). - setFocus(); } DolphinDetailsView::~DolphinDetailsView() diff --git a/src/views/dolphiniconsview.cpp b/src/views/dolphiniconsview.cpp index 522a90787..4abcad3db 100644 --- a/src/views/dolphiniconsview.cpp +++ b/src/views/dolphiniconsview.cpp @@ -126,9 +126,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, updateGridSize(view->showPreview(), 0); m_extensionsFactory = new ViewExtensionsFactory(this, dolphinViewController, viewModeController); - - // setFocus() must be called after m_extensionsFactory is initialised (see bug 240374). - setFocus(); } DolphinIconsView::~DolphinIconsView() diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 1e97d6864..b02f794b3 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1231,12 +1231,14 @@ void DolphinView::deleteView() if (view != 0) { disconnectViewAccessor(); - // It's important to set the keyboard focus to the parent - // before deleting the view: Otherwise when having a split - // view the other view will get the focus and will request - // an activation (see DolphinView::eventFilter()). - setFocusProxy(0); - setFocus(); + if (hasFocus()) { + // It's important to set the keyboard focus to the parent + // before deleting the view: Otherwise when having a split + // view the other view will get the focus and will request + // an activation (see DolphinView::eventFilter()). + setFocusProxy(0); + setFocus(); + } m_viewModeController->disconnect(view); -- 2.47.3