From: Peter Penz Date: Sat, 1 Jan 2011 20:18:43 +0000 (+0000) Subject: Forward-port: Restore keyboard-focus when changing the view-mode X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/dfaff684d6d75143e1831b16bb24fde9ffe24862 Forward-port: Restore keyboard-focus when changing the view-mode svn path=/trunk/KDE/kdebase/apps/; revision=1210699 --- diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index b02f794b3..29f62f735 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -211,6 +211,7 @@ void DolphinView::setMode(Mode mode) // be restored after reloading the directory m_selectedItems = selectedItems(); + const bool hasFocus = m_viewAccessor.itemView()->hasFocus(); deleteView(); const KUrl viewPropsUrl = rootUrl(); @@ -218,6 +219,10 @@ void DolphinView::setMode(Mode mode) props.setViewMode(m_mode); createView(); + if (hasFocus) { + m_viewAccessor.itemView()->setFocus(); + } + // the file item delegate has been recreated, apply the current // additional information manually const KFileItemDelegate::InformationList infoList = props.additionalInfo();