- for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i)
- {
- std::list<std::string> available_names = (*i)->get_names(type);
- for(std::list<std::string>::iterator j=available_names.begin(); j!=available_names.end(); ++j)
- if(!items.count(*j))
- (*i)->load(*this, type, *j);
- }
+ for(const CollectionSource *s: sources)
+ for(const string &n: s->get_names(type))
+ if(!items.count(n))
+ {
+ bool loaded = false;
+ if(type.can_create())
+ {
+ type.create_item(*this, n);
+ loaded = items.count(n);
+ }
+ if(!loaded)
+ s->load(*this, type, n);
+ }
+}
+
+void Collection::set_fallback(Collection *f)
+{
+ fallback = f;