Mark read models as "used"

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:09 +01:00
parent 2335d39fb5
commit a7781deb6a
+4 -3
View File
@@ -246,7 +246,7 @@ bool CategorizedStorageFormat::loadYaml(RadioData & radioData)
return false;
}
radioData.models.reserve(modelFiles.size());
radioData.models.resize(modelFiles.size());
int modelIdx = 0;
for (const auto& mc : modelFiles) {
@@ -267,11 +267,12 @@ bool CategorizedStorageFormat::loadYaml(RadioData & radioData)
model.modelIndex = modelIdx;
strncpy(model.filename, mc.first.c_str(), sizeof(model.filename)-1);
if (!loadModelFromYaml(radioData.models[modelIdx],modelBuffer)) {
if (!loadModelFromYaml(model,modelBuffer)) {
setError(tr("Can't load ") + filename);
return false;
}
model.used = true;
modelIdx++;
}