From 246f765a7a20bd96dcddb22ae9392874921a1cce Mon Sep 17 00:00:00 2001 From: nowrep Date: Sun, 11 Mar 2012 18:24:19 +0100 Subject: [PATCH] Changing global version of session.dat file. - rather than adding version check in tabwidget restore --- src/lib/app/mainapplication.cpp | 2 +- src/lib/webview/tabwidget.cpp | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 8f2d64d49..4f5015e1e 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -759,7 +759,7 @@ void MainApplication::aboutToCloseWindow(QupZilla* window) } //Version of session.dat file -static const int sessionVersion = 0x0002; +static const int sessionVersion = 0x0003; bool MainApplication::saveStateSlot() { diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 3d86512bc..9c34f97c9 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -571,8 +571,6 @@ QList TabWidget::allTabs(bool withPinned) return allTabs; } -static const qint32 TabWidgetFileVersion = 0xaaf; - void TabWidget::savePinnedTabs() { QByteArray data; @@ -671,7 +669,6 @@ QByteArray TabWidget::saveState() QByteArray data; QDataStream stream(&data, QIODevice::WriteOnly); - stream << TabWidgetFileVersion; stream << tabList.count(); foreach(const WebTab::SavedTab & tab, tabList) { @@ -690,17 +687,11 @@ bool TabWidget::restoreState(QByteArray &state) return false; } - qint32 fileVersion = 0; int tabListCount = 0; int currentTab = 0; - stream >> fileVersion; stream >> tabListCount; - if (fileVersion != TabWidgetFileVersion) { - return false; - } - for (int i = 0; i < tabListCount; ++i) { WebTab::SavedTab tab; stream >> tab;