-QDataStream &operator>>(QDataStream &in, ChatLineModel::WrapList &wplist) {
- quint16 cnt;
- in >> cnt;
- wplist.resize(cnt);
- for(quint16 i = 0; i < cnt; i++) {
- in >> wplist[i].start >> wplist[i].width >> wplist[i].trailing;
- }
- return in;
+
+QDataStream &operator<<(QDataStream &out, const ChatLineModel::WrapList wplist)
+{
+ out << wplist.count();
+ ChatLineModel::WrapList::const_iterator it = wplist.begin();
+ while (it != wplist.end()) {
+ out << (*it).start << (*it).width << (*it).trailing;
+ ++it;
+ }
+ return out;
+}
+
+
+QDataStream &operator>>(QDataStream &in, ChatLineModel::WrapList &wplist)
+{
+ quint16 cnt;
+ in >> cnt;
+ wplist.resize(cnt);
+ for (quint16 i = 0; i < cnt; i++) {
+ in >> wplist[i].start >> wplist[i].width >> wplist[i].trailing;
+ }
+ return in;