summaryrefslogtreecommitdiff
path: root/lyt/group.cpp
blob: c3a16fb9c8633021fa919d7156d6cd5365e23b7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "group.h"

LYTGroup::LYTGroup() {
}




void LYTGroup::writeToDataStream(QDataStream &out) {
	WriteFixedLengthASCII(out, name, 0x10);

	// write the contents
	out << (quint16)panes.count();
	out.skipRawData(2); // padding

	foreach (LYTPane *pane, panes) {
		WriteFixedLengthASCII(out, pane->name, 0x10);
	}
}


void LYTGroup::readFromDataStream(QDataStream &in, LYTPane &linkedPane) {
	name = ReadFixedLengthASCII(in, 0x10);
	qDebug() << "reading group" << name;

	// read the contents
	quint16 paneCount;
	in >> (quint16&)paneCount;
	in.skipRawData(2); // padding

	for (int i = 0; i < paneCount; i++) {
		QString paneName = ReadFixedLengthASCII(in, 0x10);

		qDebug() << "found" << paneName << "in group" << this->name;

		this->panes.append(linkedPane.findPaneByName(paneName, true));
	}
}