From e4b5a416b30f06fd975ebef518fe11848731acc9 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 17 Dec 2015 22:26:32 +0100 Subject: [PATCH] Fix WebTab::SavedTab incompatibility with older versions @innermous --- src/lib/webtab/webtab.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index c269be8d9..d01018b40 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -35,10 +35,11 @@ #include 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;