diff options
| author | Oliver Schramm <[email protected]> | 2025-12-23 11:02:05 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2025-12-23 10:02:05 +0000 |
| commit | bd20879e3bbb42fc3a11ec90ba67db32b9b62f6d (patch) | |
| tree | 35df707f916ed75435656c1fdd95691a982fa169 /src/dolphintabpage.cpp | |
| parent | e7dae5f49e1b02c5c4ddcf0cd7694807a844acc6 (diff) | |
dolphintabbpage: Allow migration for users with the old session file format
Commit 8d44699f introduced a new session file format, without providing a migration path for the old file format, which led to users losing their session.
Besides adding the migration path, the condition check for future updates is necessary, since we don't provide guarantees for backwards-compatible format changes. In case users downgrade their Dolphin version/immutable distro or they share the Dolphin config file across multiple systems, Dolphin at least won't crash when reading a session file with a newer format.
BUG: 513466
Diffstat (limited to 'src/dolphintabpage.cpp')
| -rw-r--r-- | src/dolphintabpage.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index 8373d17b8..ce091cfc1 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -336,7 +336,7 @@ void DolphinTabPage::restoreState(const QByteArray &state) // Read the version number of the tab state and check if the version is supported. quint32 version = 0; stream >> version; - if (version != 3) { + if (version < 2 || version > 3) { // The version of the tab state isn't supported, we can't restore it. return; } @@ -374,7 +374,9 @@ void DolphinTabPage::restoreState(const QByteArray &state) QByteArray splitterState; stream >> splitterState; m_splitter->restoreState(splitterState); - stream >> m_splitterLastPosition; + if (version >= 3) { + stream >> m_splitterLastPosition; + } if (!stream.atEnd()) { QString tabTitle; |
