fix: no blocks data conversion if no data loss detected

This commit is contained in:
MihailRis
2024-10-01 21:05:08 +03:00
parent bc05716772
commit 024dccb135
6 changed files with 17 additions and 1 deletions
+4 -1
View File
@@ -81,6 +81,9 @@ std::shared_ptr<ContentReport> ContentReport::create(
);
}
}
if (layout != *def->dataStruct) {
report->dataLayoutsUpdated = true;
}
report->blocksDataLayouts[name] = std::move(layout);
}
@@ -89,7 +92,7 @@ std::shared_ptr<ContentReport> ContentReport::create(
if (report->isUpgradeRequired() ||
report->hasContentReorder() ||
report->hasMissingContent() ||
report->hasDataLoss()) {
report->hasUpdatedLayouts()) {
return report;
} else {
return nullptr;
+5
View File
@@ -128,6 +128,8 @@ public:
std::vector<ContentIssue> issues;
std::vector<std::string> dataLoss;
bool dataLayoutsUpdated = false;
ContentReport(
const ContentIndices* indices,
size_t blocks,
@@ -144,6 +146,9 @@ public:
inline const std::vector<std::string>& getDataLoss() const {
return dataLoss;
}
inline bool hasUpdatedLayouts() {
return dataLayoutsUpdated;
}
inline bool hasContentReorder() const {
return blocks.hasContentReorder() || items.hasContentReorder();