From 5d8947f19f57b3eb372a811d417a58d6d0aa4f28 Mon Sep 17 00:00:00 2001 From: elecpower Date: Wed, 22 Dec 2021 17:20:10 +1100 Subject: [PATCH] Fix grouping models by category --- 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 ae13a3b43..7f9a52ce2 100644 --- a/companion/src/storage/categorized.cpp +++ b/companion/src/storage/categorized.cpp @@ -263,15 +263,16 @@ bool CategorizedStorageFormat::loadYaml(RadioData & radioData) // ModelData() use memset to clear everything to 0 // auto& model = radioData.models[modelIdx]; - model.category = mc.second; - model.modelIndex = modelIdx; - strncpy(model.filename, mc.first.c_str(), sizeof(model.filename)-1); if (!loadModelFromYaml(model,modelBuffer)) { setError(tr("Can't load ") + filename); return false; } + model.category = mc.second; + model.modelIndex = modelIdx; + strncpy(model.filename, mc.first.c_str(), sizeof(model.filename)-1); + model.used = true; modelIdx++; }