Don't rely on that the same proxy model is used for all views. Trigger a refresh of the directory (done from the cache) and remember the selection. This fixes also the issue that the selection got lost when previews have been enabled or when the column view was used.

BUG: 217562
CCBUG: 211149

svn path=/trunk/KDE/kdebase/apps/; revision=1063960
This commit is contained in:
Peter Penz 2009-12-19 17:38:38 +00:00
parent ea258a5f09
commit 11abae0a1d

View file

@ -222,6 +222,10 @@ void DolphinView::setMode(Mode mode)
const int oldZoomLevel = m_controller->zoomLevel();
m_mode = mode;
// remember the currently selected items, so that they will
// be restored after reloading the directory
m_selectedItems = selectedItems();
deleteView();
const KUrl viewPropsUrl = rootUrl();
@ -248,9 +252,7 @@ void DolphinView::setMode(Mode mode)
emit modeChanged();
updateZoomLevel(oldZoomLevel);
if (m_showPreview) {
loadDirectory(viewPropsUrl);
}
loadDirectory(viewPropsUrl);
}
DolphinView::Mode DolphinView::mode() const