]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Preserve selected items when changing folders
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sat, 18 Feb 2017 19:48:49 +0000 (20:48 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sat, 18 Feb 2017 19:48:49 +0000 (20:48 +0100)
Based on the idea of Martin Tobias Holmedahl Sandsmark

src/views/dolphinview.cpp

index c7267cee0d9bcedefcd1b4b8260fa542bb21ce91..ed4a1244c06c44106e2c8fc5cf6eb40ea18cc462 100644 (file)
@@ -1211,6 +1211,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;
 
@@ -1235,6 +1238,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();