Commit c8212dd0 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

ItemSerializerPlugin: fix apply() after merging V2 into V1

We have to use the method that was marked as "old-school" in the
original code, because unlike the "new-school" one, it preserved
payload version.
parent 3528935d
......@@ -55,17 +55,19 @@ QSet<QByteArray> ItemSerializerPlugin::availableParts(const Item &item) const
void ItemSerializerPlugin::apply(Item &item, const Item &other)
QBuffer buffer;
QByteArray data(other.payloadData());
foreach (const QByteArray &part, other.loadedPayloadParts()) {
Q_FOREACH (const QByteArray &part, other.loadedPayloadParts()) {
QByteArray partData;
QBuffer buffer;
int version;
// NOTE: we can't just pass other.payloadData() into deserialize(),
// because that does not preserve payload version.
serialize(other, part, buffer, version);;
deserialize(item, part, buffer, 0);
deserialize(item, part, buffer, version);
QSet<QByteArray> ItemSerializerPlugin::allowedForeignParts(const Item &item) const
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment