Skip to content

Commit

Permalink
itemencrypted: Fix saving large items
Browse files Browse the repository at this point in the history
Fixes a bug introduced with the separate large data files.
  • Loading branch information
hluk committed Dec 20, 2023
1 parent 7481dab commit cda22d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/itemencrypted/itemencrypted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ bool ItemEncryptedSaver::saveItems(const QString &, const QAbstractItemModel &mo

for (int i = 0; i < length && stream.status() == QDataStream::Ok; ++i) {
QModelIndex index = model.index(i, 0);
const QVariantMap dataMap = index.data(contentType::data).toMap();
QVariantMap dataMap = index.data(contentType::data).toMap();
for (auto it = dataMap.begin(); it != dataMap.end(); ++it) {
if (it.value().type() != QVariant::ByteArray)
it.value() = it.value().toByteArray();
}
stream << dataMap;
}
}
Expand Down

0 comments on commit cda22d5

Please sign in to comment.