X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/230fe13d1fccf8c2ab09c0873c1cc4c733cfc3b4..6dcbb8127c:/src/views/dolphinview.cpp diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index bfed3e847..63f6252ed 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -453,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); @@ -584,7 +581,6 @@ void DolphinView::setUrl(const QUrl& url) clearSelection(); - emit urlAboutToBeChanged(url); m_url = url; hideToolTip(); @@ -731,6 +727,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event) switch (event->type()) { case QEvent::PaletteChange: updatePalette(); + QPixmapCache::clear(); break; case QEvent::KeyPress: @@ -1210,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; @@ -1234,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(); @@ -1368,6 +1371,7 @@ void DolphinView::updateViewState() } } + selectionManager->beginAnchoredSelection(selectionManager->currentItem()); selectionManager->setSelectedItems(selectedItems); } }