-QVariantList BufferSyncer::initLastSeenMsg() const {
- QVariantList list;
- QHash<BufferId, MsgId>::const_iterator iter = _lastSeenMsg.constBegin();
- while(iter != _lastSeenMsg.constEnd()) {
- list << QVariant::fromValue<BufferId>(iter.key())
- << QVariant::fromValue<MsgId>(iter.value());
- iter++;
- }
- return list;
+
+QVariantList BufferSyncer::initLastSeenMsg() const
+{
+ QVariantList list;
+ QHash<BufferId, MsgId>::const_iterator iter = _lastSeenMsg.constBegin();
+ while (iter != _lastSeenMsg.constEnd()) {
+ list << QVariant::fromValue<BufferId>(iter.key())
+ << QVariant::fromValue<MsgId>(iter.value());
+ ++iter;
+ }
+ return list;
+}
+
+
+void BufferSyncer::initSetLastSeenMsg(const QVariantList &list)
+{
+ _lastSeenMsg.clear();
+ Q_ASSERT(list.count() % 2 == 0);
+ for (int i = 0; i < list.count(); i += 2) {
+ setLastSeenMsg(list.at(i).value<BufferId>(), list.at(i+1).value<MsgId>());
+ }
+}
+
+
+QVariantList BufferSyncer::initMarkerLines() const
+{
+ QVariantList list;
+ QHash<BufferId, MsgId>::const_iterator iter = _markerLines.constBegin();
+ while (iter != _markerLines.constEnd()) {
+ list << QVariant::fromValue<BufferId>(iter.key())
+ << QVariant::fromValue<MsgId>(iter.value());
+ ++iter;
+ }
+ return list;