Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
fix some serialization regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
cpdt committed Jul 21, 2018
1 parent b116ef6 commit 28a1fa3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion editor/model/Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ Library::~Library() = default;

Library::Library(QString activeTag, QString activeSearch,
std::vector<std::unique_ptr<AxiomModel::LibraryEntry>> entries)
: _entries(std::move(entries)), _activeTag(std::move(activeTag)), _activeSearch(std::move(activeSearch)) {}
: _entries(std::move(entries)), _activeTag(std::move(activeTag)), _activeSearch(std::move(activeSearch)) {
// add tags of all entries
for (const auto &entry : _entries) {
for (const auto &tag : entry->tags()) {
addTag(tag);
}
}
}

void Library::import(
AxiomModel::Library *library,
Expand Down
2 changes: 1 addition & 1 deletion editor/model/serialize/ModelObjectSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace AxiomModel {
for (const auto &obj : objects) {
QByteArray objectBuffer;
QDataStream objectStream(&objectBuffer, QIODevice::WriteOnly);
serialize(obj, stream, parent);
serialize(obj, objectStream, parent);
stream << objectBuffer;
}
}
Expand Down
1 change: 1 addition & 0 deletions editor/model/serialize/NodeSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ std::unique_ptr<Node> NodeSerializer::deserialize(QDataStream &stream, uint32_t

QPoint pos;
stream >> pos;
pos = ref->mapPos(parentUuid, pos);

QSize size;
stream >> size;
Expand Down
1 change: 1 addition & 0 deletions editor/model/serialize/ProjectSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ bool ProjectSerializer::readHeader(QDataStream &stream, uint64_t expectedMagic,
void ProjectSerializer::serialize(AxiomModel::Project *project, QDataStream &stream) {
writeHeader(stream, projectSchemaMagic);
ModelObjectSerializer::serializeRoot(&project->mainRoot(), stream);
LibrarySerializer::serialize(&project->library(), stream);
}

std::unique_ptr<Project> ProjectSerializer::deserialize(QDataStream &stream, uint32_t *versionOut) {
Expand Down

0 comments on commit 28a1fa3

Please sign in to comment.