diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-13 14:19:29 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-13 14:20:55 (GMT) |
commit | a43df009713c7df7b19336db5cee8306da62d186 (patch) | |
tree | 5a3650f2c73f0831a100f6f7993211ad4cb87d30 /src/3rdparty | |
parent | 9af4c9174b507b9e56c95a196683b1f3a59cce90 (diff) | |
download | Qt-a43df009713c7df7b19336db5cee8306da62d186.zip Qt-a43df009713c7df7b19336db5cee8306da62d186.tar.gz Qt-a43df009713c7df7b19336db5cee8306da62d186.tar.bz2 |
QtWebKit: Fix the QWebHistory serialization auto-test
This patch should be overwritten by the next WebKit import.
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp | 21 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 4 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp index c5fb069..8bbd233 100644 --- a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp +++ b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp @@ -25,9 +25,8 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) { - // we only support version 1 for now - - if (version != 1) + // we support up to version 2 + if (version > 2) return false; WebCore::String url; @@ -48,6 +47,7 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) WebCore::IntPoint scrollPoint; WTF::Vector<int> weeklyVisitCounts; WTF::Vector<int> dailyVisitCounts; + long long documentSequenceNumber; // bool loadFormdata; // WebCore::String formContentType; // WTF::Vector<char> formData; @@ -79,6 +79,12 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) setTitle(title); setAlternateTitle(altTitle); + if (version > 1) + { + in >> documentSequenceNumber; + setDocumentSequenceNumber(documentSequenceNumber); + } + // at the end load userData in >> validUserData; if (validUserData) { @@ -92,15 +98,16 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) QDataStream& WebCore::HistoryItem::saveState(QDataStream& out, int version) const { - // we only support version 1 for now. - if (version != 1) - return out; - out << urlString() << title() << alternateTitle() << lastVisitedTime(); out << originalURLString() << referrer() << target() << parent(); out << lastVisitWasHTTPNonGet() << lastVisitWasFailure() << isTargetItem(); out << visitCount() << documentState() << scrollPoint(); out << dailyVisitCounts() << weeklyVisitCounts(); + + // Since version 2 + Q_ASSERT_X(version > 1, "HistoryItem::saveState()", "Stream version should be greater than 1"); + out << documentSequenceNumber(); + /*if (m_formData) { out << true; out << formContentType(); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp index d852012..61ec9d2 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp @@ -33,7 +33,7 @@ enum { InitialHistoryVersion = 1, - DefaultHistoryVersion = InitialHistoryVersion + DefaultHistoryVersion = 2 }; /*! @@ -524,7 +524,7 @@ QDataStream& operator>>(QDataStream& source, QWebHistory& history) source >> version; - if (version == 1) { + if (version <= 2) { int count; int currentIndex; source >> count >> currentIndex; |