X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fcollection.cpp;h=65b4d5a3914192192f2092425e686b7d8ee56576;hp=165b77007fce815eac0b4498d58950895ca1706d;hb=619629ce1ce6343630b967c9fb46ab43256ddfe1;hpb=2af11bfb5184092e58cb9a0055ae03a271af28cb 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); + } } }