diff options
| author | Emmanuel Pescosta <[email protected]> | 2014-08-22 23:17:02 +0200 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2014-08-22 23:17:02 +0200 |
| commit | d4fb129710d7fadf8e21f2cfd2588a794f774e41 (patch) | |
| tree | 03f73790c290013aa7026ebea723e7e18741c999 /src/views | |
| parent | ee946d362c64ee35af932b3cad54d23ad786fe55 (diff) | |
| parent | 7b0c9bbc58fc543a116104155fc8f3d81113d3a8 (diff) | |
Merge branch 'master' into frameworks
Conflicts:
dolphin/src/dolphinmainwindow.cpp
dolphin/src/dolphinmainwindow.h
dolphin/src/dolphinrecenttabsmenu.cpp
dolphin/src/dolphinviewcontainer.cpp
kfind/CMakeLists.txt
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinview.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index e57881c10..e7034984e 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1176,6 +1176,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; @@ -1190,6 +1198,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) { @@ -1298,11 +1308,11 @@ void DolphinView::updateViewState() m_view->scrollToItem(currentIndex); m_scrollToCurrentItem = false; } - - m_currentItemUrl = KUrl(); } else { selectionManager->setCurrentItem(0); } + + m_currentItemUrl = KUrl(); } if (!m_restoredContentsPosition.isNull()) { |
