X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fcollection.cpp;h=cffb7e22e7041ba48268c9643c6d7791e118407f;hp=165b77007fce815eac0b4498d58950895ca1706d;hb=7feeeacf8fa3eae889cb256c42ada615c4761eec;hpb=2af11bfb5184092e58cb9a0055ae03a271af28cb diff --git a/source/collection.cpp b/source/collection.cpp index 165b770..cffb7e2 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -92,7 +92,7 @@ void Collection::add_source(CollectionSource &s) sources.push_back(&s); } -IO::Seekable *Collection::open_from_sources(const string &name) +IO::Seekable *Collection::open_raw(const string &name) const { for(SourceList::const_iterator i=sources.begin(); i!=sources.end(); ++i) if(IO::Seekable *io = (*i)->open(name)) @@ -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); + } } }