mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +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
|
//Version of session.dat file
|
||||||
static const int sessionVersion = 0x0002;
|
static const int sessionVersion = 0x0003;
|
||||||
|
|
||||||
bool MainApplication::saveStateSlot()
|
bool MainApplication::saveStateSlot()
|
||||||
{
|
{
|
||||||
|
@ -571,8 +571,6 @@ QList<WebTab*> TabWidget::allTabs(bool withPinned)
|
|||||||
return allTabs;
|
return allTabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const qint32 TabWidgetFileVersion = 0xaaf;
|
|
||||||
|
|
||||||
void TabWidget::savePinnedTabs()
|
void TabWidget::savePinnedTabs()
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
@ -671,7 +669,6 @@ QByteArray TabWidget::saveState()
|
|||||||
QByteArray data;
|
QByteArray data;
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
|
||||||
stream << TabWidgetFileVersion;
|
|
||||||
stream << tabList.count();
|
stream << tabList.count();
|
||||||
|
|
||||||
foreach(const WebTab::SavedTab & tab, tabList) {
|
foreach(const WebTab::SavedTab & tab, tabList) {
|
||||||
@ -690,17 +687,11 @@ bool TabWidget::restoreState(QByteArray &state)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
qint32 fileVersion = 0;
|
|
||||||
int tabListCount = 0;
|
int tabListCount = 0;
|
||||||
int currentTab = 0;
|
int currentTab = 0;
|
||||||
|
|
||||||
stream >> fileVersion;
|
|
||||||
stream >> tabListCount;
|
stream >> tabListCount;
|
||||||
|
|
||||||
if (fileVersion != TabWidgetFileVersion) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < tabListCount; ++i) {
|
for (int i = 0; i < tabListCount; ++i) {
|
||||||
WebTab::SavedTab tab;
|
WebTab::SavedTab tab;
|
||||||
stream >> tab;
|
stream >> tab;
|
||||||
|
Loading…
Reference in New Issue
Block a user