X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/41253c0c81bafb54a0b6c82e5282e3add85e8a50..68bb0ec22a:/src/views/dolphinview.cpp diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 9728e58c3..63f6252ed 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -454,10 +454,6 @@ void DolphinView::reload() QDataStream saveStream(&viewState, QIODevice::WriteOnly); saveState(saveStream); - const KFileItemList itemList = selectedItems(); - m_selectedUrls.clear(); - m_selectedUrls = itemList.urlList(); - setUrl(url()); loadDirectory(url(), true); @@ -585,7 +581,6 @@ void DolphinView::setUrl(const QUrl& url) clearSelection(); - emit urlAboutToBeChanged(url); m_url = url; hideToolTip(); @@ -1212,6 +1207,9 @@ void DolphinView::restoreState(QDataStream& stream) // Restore the current item that had the keyboard focus stream >> m_currentItemUrl; + // Restore the previously selected items + stream >> m_selectedUrls; + // Restore the view position stream >> m_restoredContentsPosition; @@ -1236,6 +1234,9 @@ void DolphinView::saveState(QDataStream& stream) stream << QUrl(); } + // Save the selected urls + stream << selectedItems().urlList(); + // Save view position const qreal x = m_container->horizontalScrollBar()->value(); const qreal y = m_container->verticalScrollBar()->value(); @@ -1370,6 +1371,7 @@ void DolphinView::updateViewState() } } + selectionManager->beginAnchoredSelection(selectionManager->currentItem()); selectionManager->setSelectedItems(selectedItems); } }