Piece Name and UUID taken into account in *vlt reader / writer
This commit is contained in:
parent
25cb7f9e6e
commit
39c889d43b
|
@ -247,7 +247,13 @@ void VPuzzleLayoutFileReader::ReadPiece(VPuzzlePiece *piece)
|
|||
Q_UNUSED(piece);
|
||||
Q_ASSERT(isStartElement() && name() == ML::TagPiece);
|
||||
|
||||
// TODO read the attributes
|
||||
QXmlStreamAttributes attribs = attributes();
|
||||
piece->SetName(ReadAttributeString(attribs, ML::AttrName, tr("Piece")));
|
||||
QString uuidStr = ReadAttributeString(attribs, ML::AttrID, QUuid().toString());// FIXME: is that correct to have a default value here?
|
||||
piece->SetUuid(QUuid(uuidStr));
|
||||
|
||||
// TODO read the further attributes
|
||||
|
||||
|
||||
while (readNextStartElement())
|
||||
{
|
||||
|
|
|
@ -163,8 +163,8 @@ void VPuzzleLayoutFileWriter::WritePiece(VPuzzlePiece *piece)
|
|||
Q_UNUSED(piece);
|
||||
|
||||
writeStartElement(ML::TagPiece);
|
||||
SetAttribute(ML::AttrID, "uuid1"); // TODO / Fixme get the right value
|
||||
SetAttribute(ML::AttrName, "Piece name"); // TODO / Fixme get the right value
|
||||
SetAttribute(ML::AttrID, piece->GetUuid().toString());
|
||||
SetAttribute(ML::AttrName, piece->GetName());
|
||||
SetAttribute(ML::AttrMirrored, "false"); // TODO / Fixme get the right value
|
||||
SetAttribute(ML::AttrTransform, "string representation of the transformation"); // TODO / Fixme get the right value
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user