Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #109 from matthewvogt/mer-1303-2
[commhistoryd] Correct deserialization logic. Contributes to MER#1303
  • Loading branch information
matthewvogt committed Sep 25, 2015
2 parents 25f5c57 + 5cf14b7 commit 1835aff
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/serialisable.cpp
Expand Up @@ -50,10 +50,12 @@ void Serialisable::deSerialize(QDataStream& in, QObject& object)
{
for(int i = 1; i < object.metaObject()->propertyCount(); i++) {
QMetaProperty prop = object.metaObject()->property(i);
const char* propName = prop.name();
QVariant variant;
if (!in.atEnd())
in >> variant;
object.setProperty(propName, variant);
if (prop.isWritable()) {
const char* propName = prop.name();
QVariant variant;
if (!in.atEnd())
in >> variant;
object.setProperty(propName, variant);
}
}
}

0 comments on commit 1835aff

Please sign in to comment.