From a7781deb6a5f136b81e245215ad86e81da38319d Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Wed, 1 Dec 2021 12:34:25 +0100 Subject: [PATCH] Mark read models as "used" --- companion/src/storage/categorized.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/companion/src/storage/categorized.cpp b/companion/src/storage/categorized.cpp index f09253280..420a9b666 100644 --- a/companion/src/storage/categorized.cpp +++ b/companion/src/storage/categorized.cpp @@ -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++; }