X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fpacksource.cpp;h=f4c06b5deab36260d50b4736009977b569db6270;hb=116ea4040cbfa5b6985e95577fd7e029cc2bf30b;hp=fe9e67db6eabae37ae1b38278d68104b305f2739;hpb=010737b64c8d4e7fcf0fe953ed15769eeac4178f;p=libs%2Fdatafile.git diff --git a/source/packsource.cpp b/source/packsource.cpp index fe9e67d..f4c06b5 100644 --- a/source/packsource.cpp +++ b/source/packsource.cpp @@ -60,9 +60,11 @@ void PackSource::add_pack(IO::Seekable *io, const string &fn, const string &filt FileMap pack_files; pack->collect_files(pack_files, filter); - files.insert(pack_files.begin(), pack_files.end()); for(FileMap::const_iterator i=pack_files.begin(); i!=pack_files.end(); ++i) + { + files[i->first] = i->second; i->second->collect_objects(objects); + } } list PackSource::list_files() const @@ -112,9 +114,6 @@ void PackSource::load(Collection &coll, const CollectionItemTypeBase &type, cons return; File &file = i->second->get_file(); - if(file.is_loaded()) - return; - file.set_loaded(); RefPtr in = file.open(); Parser parser(*in, file.get_full_name()); @@ -165,8 +164,7 @@ PackSource::File::File(const Pack &p, const string &fn): filename(fn), offset(0), length(0), - collection(false), - loaded(false) + collection(false) { } RefPtr PackSource::File::open() const @@ -196,11 +194,6 @@ string PackSource::File::get_full_name() const return format("%s/%s", pack.get_filename(), filename); } -void PackSource::File::set_loaded() -{ - loaded = true; -} - void PackSource::File::collect_objects(ObjectMap &objs) const { for(list::const_iterator i=objects.begin(); i!=objects.end(); ++i)