diff --git a/radio/src/storage/modelslist.cpp b/radio/src/storage/modelslist.cpp index f9db2954d..4430d2104 100644 --- a/radio/src/storage/modelslist.cpp +++ b/radio/src/storage/modelslist.cpp @@ -262,9 +262,10 @@ void ModelsCategory::save(FIL * file) f_puts("]", file); f_putc('\n', file); #else - f_puts("- name: ", file); + f_puts("- ", file); f_puts(name, file); f_putc('\n', file); + //f_puts(" models:\n", file); #endif for (list::iterator it = begin(); it != end(); ++it) { (*it)->save(file); diff --git a/radio/src/storage/yaml/yaml_modelslist.cpp b/radio/src/storage/yaml/yaml_modelslist.cpp index 7be9062aa..dd3384751 100644 --- a/radio/src/storage/yaml/yaml_modelslist.cpp +++ b/radio/src/storage/yaml/yaml_modelslist.cpp @@ -89,6 +89,12 @@ static bool find_node(void* ctx, char* buf, uint8_t len) memcpy(mi->current_attr, buf, len); mi->current_attr[len] = '\0'; + list& cats = mi->root->getCategories(); + if (mi->level == modelslist_iter::Category) { + ModelsCategory* cat = new ModelsCategory(buf,len); + cats.push_back(cat); + } + return true; } @@ -97,10 +103,6 @@ static void set_attr(void* ctx, char* buf, uint8_t len) modelslist_iter* mi = (modelslist_iter*)ctx; list& cats = mi->root->getCategories(); switch(mi->level) { - case modelslist_iter::Category: { - ModelsCategory* cat = new ModelsCategory(buf,len); - cats.push_back(cat); - } break; case modelslist_iter::Model: if (!strcmp(mi->current_attr,"filename")) {