mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Fix WebTab::SavedTab incompatibility with older versions
@innermous
This commit is contained in:
parent
5801ff0725
commit
e4b5a416b3
@ -35,10 +35,11 @@
|
||||
#include <QSplitter>
|
||||
|
||||
bool WebTab::s_pinningTab = false;
|
||||
static const int savedTabVersion = 2;
|
||||
static const int savedTabVersion = 3;
|
||||
|
||||
WebTab::SavedTab::SavedTab()
|
||||
: isPinned(false)
|
||||
, zoomLevel(qzSettings->defaultZoomLevel)
|
||||
{
|
||||
}
|
||||
|
||||
@ -47,9 +48,9 @@ WebTab::SavedTab::SavedTab(WebTab* webTab)
|
||||
title = webTab->title();
|
||||
url = webTab->url();
|
||||
icon = webTab->icon();
|
||||
zoomLevel = webTab->zoomLevel();
|
||||
history = webTab->historyData();
|
||||
isPinned = webTab->isPinned();
|
||||
zoomLevel = webTab->zoomLevel();
|
||||
}
|
||||
|
||||
bool WebTab::SavedTab::isValid() const
|
||||
@ -64,6 +65,7 @@ void WebTab::SavedTab::clear()
|
||||
icon = QIcon();
|
||||
history.clear();
|
||||
isPinned = false;
|
||||
zoomLevel = qzSettings->defaultZoomLevel;
|
||||
}
|
||||
|
||||
QDataStream &operator <<(QDataStream &stream, const WebTab::SavedTab &tab)
|
||||
@ -73,8 +75,8 @@ QDataStream &operator <<(QDataStream &stream, const WebTab::SavedTab &tab)
|
||||
stream << tab.url;
|
||||
stream << tab.icon.pixmap(16);
|
||||
stream << tab.history;
|
||||
stream << tab.zoomLevel;
|
||||
stream << tab.isPinned;
|
||||
stream << tab.zoomLevel;
|
||||
|
||||
return stream;
|
||||
}
|
||||
@ -92,11 +94,13 @@ QDataStream &operator >>(QDataStream &stream, WebTab::SavedTab &tab)
|
||||
stream >> tab.url;
|
||||
stream >> pixmap;
|
||||
stream >> tab.history;
|
||||
stream >> tab.zoomLevel;
|
||||
|
||||
if (version >= 2)
|
||||
stream >> tab.isPinned;
|
||||
|
||||
if (version >= 3)
|
||||
stream >> tab.zoomLevel;
|
||||
|
||||
tab.icon = QIcon(pixmap);
|
||||
|
||||
return stream;
|
||||
|
Loading…
Reference in New Issue
Block a user