diff options
| author | Emmanuel Pescosta <[email protected]> | 2014-08-20 23:06:39 +0200 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2014-08-20 23:06:39 +0200 |
| commit | 2d2d55f3df09614e6b7cf267771b52a04dcb5e28 (patch) | |
| tree | 50588d8f2628da5ec804656616ea2ed07e22e76b /src/views | |
| parent | 4b758c386fb3957160af334230bacd96ed810d2c (diff) | |
Save the view states in addition to the view urls and splitter state in DolphinTabPage.
Also added version numbers to view and tab state.
REVIEW: 119792
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinview.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 02b8815e0..1de973bd5 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1167,6 +1167,14 @@ bool DolphinView::itemsExpandable() const void DolphinView::restoreState(QDataStream& stream) { + // Read the version number of the view state and check if the version is supported. + quint32 version = 0; + stream >> version; + if (version != 1) { + // The version of the view state isn't supported, we can't restore it. + return; + } + // Restore the current item that had the keyboard focus stream >> m_currentItemUrl; @@ -1181,6 +1189,8 @@ void DolphinView::restoreState(QDataStream& stream) void DolphinView::saveState(QDataStream& stream) { + stream << quint32(1); // View state version + // Save the current item that has the keyboard focus const int currentIndex = m_container->controller()->selectionManager()->currentItem(); if (currentIndex != -1) { |
