diff options
Diffstat (limited to 'libkonq/konq_historycomm.cc')
-rw-r--r-- | libkonq/konq_historycomm.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libkonq/konq_historycomm.cc b/libkonq/konq_historycomm.cc new file mode 100644 index 000000000..0875a7945 --- /dev/null +++ b/libkonq/konq_historycomm.cc @@ -0,0 +1,41 @@ +#include "konq_historycomm.h" + +bool KonqHistoryEntry::marshalURLAsStrings; + +// QDataStream operators (read and write a KonqHistoryEntry +// from/into a QDataStream) +QDataStream& operator<< (QDataStream& s, const KonqHistoryEntry& e) { + if (KonqHistoryEntry::marshalURLAsStrings) + s << e.url.url(); + else + s << e.url; + + s << e.typedURL; + s << e.title; + s << e.numberOfTimesVisited; + s << e.firstVisited; + s << e.lastVisited; + + return s; +} + +QDataStream& operator>> (QDataStream& s, KonqHistoryEntry& e) { + if (KonqHistoryEntry::marshalURLAsStrings) + { + QString url; + s >> url; + e.url = url; + } + else + { + s>>e.url; + } + + s >> e.typedURL; + s >> e.title; + s >> e.numberOfTimesVisited; + s >> e.firstVisited; + s >> e.lastVisited; + + return s; +} |