From 619629ce1ce6343630b967c9fb46ab43256ddfe1 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 12 Oct 2013 18:55:33 +0300 Subject: [PATCH] Invoke creators from get_list --- source/collection.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/collection.cpp b/source/collection.cpp index 165b770..65b4d5a 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -121,7 +121,16 @@ void Collection::load_items_from_sources(const CollectionItemTypeBase &type) std::list available_names = (*i)->get_names(type); for(std::list::iterator j=available_names.begin(); j!=available_names.end(); ++j) if(!items.count(*j)) - (*i)->load(*this, type, *j); + { + bool loaded = false; + if(type.can_create()) + { + type.create_item(*this, *j); + loaded = items.count(*j); + } + if(!loaded) + (*i)->load(*this, type, *j); + } } } -- 2.43.0