io/fileview: fix swapped new/old branch in JsonAdapter deserialize

This commit is contained in:
outfoxxed committed 2026-08-15 14:44:52 -07:00
1 parent 28771c7c74
commit d9cbc90a8c
2 files changed
+6 -5

No files matched your search

+1
View File
@@ -12,3 +12,4 @@
- Fixed unhandled notifications sending `NotificationClosed` out of order. - Fixed unhandled notifications sending `NotificationClosed` out of order.
- Fixed `qs kill` not waiting for the process to exit. - Fixed `qs kill` not waiting for the process to exit.
- Fixed IPC calls from children of a crashed and relaunched process crashing. - Fixed IPC calls from children of a crashed and relaunched process crashing.
- Fixed JsonAdapter crashing when deserializing new objects into an array.
+5 -5
View File
@@ -225,15 +225,15 @@ void JsonAdapter::deserializeRec(const QJsonObject& json, QObject* obj, const QM
const auto& jsonValue = array.at(i); const auto& jsonValue = array.at(i);
if (jsonValue.isObject()) { if (jsonValue.isObject()) {
if (isNew) { if (isNew) {
currentValue = lp.at(&lp, i);
if (this->oldCreatedObjects.removeOne(currentValue)) {
this->createdObjects.push_back(currentValue);
}
} else {
// FIXME: should be the type inside the QQmlListProperty but how can we get that? // FIXME: should be the type inside the QQmlListProperty but how can we get that?
currentValue = static_cast<JsonObject*>(QMetaType::fromType<JsonObject>().create()); currentValue = static_cast<JsonObject*>(QMetaType::fromType<JsonObject>().create());
currentValue->setParent(this); currentValue->setParent(this);
this->createdObjects.push_back(currentValue); this->createdObjects.push_back(currentValue);
} else {
currentValue = lp.at(&lp, i);
if (this->oldCreatedObjects.removeOne(currentValue)) {
this->createdObjects.push_back(currentValue);
}
} }
this->deserializeRec( this->deserializeRec(