mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Changing global version of session.dat file.
- rather than adding version check in tabwidget restore
This commit is contained in:
parent
9042e7860d
commit
246f765a7a
@ -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()
|
||||
{
|
||||
|
@ -571,8 +571,6 @@ QList<WebTab*> 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;
|
||||
|
Loading…
Reference in New Issue
Block a user