]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/packsource.cpp
Make the File reference in PackSource::Object const
[libs/datafile.git] / source / packsource.cpp
index 1accdb0fc3a384c456f4535db23e164a89efb5b7..ec7232aa3f057fb51786d146675142483a788490 100644 (file)
@@ -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::FileInfo> PackSource::list_files() const
@@ -111,7 +113,7 @@ void PackSource::load(Collection &coll, const CollectionItemTypeBase &type, cons
        if(i==objects.end())
                return;
 
-       File &file = i->second->get_file();
+       const File &file = i->second->get_file();
 
        RefPtr<IO::Base> in = file.open();
        Parser parser(*in, file.get_full_name());
@@ -199,7 +201,7 @@ void PackSource::File::collect_objects(ObjectMap &objs) const
 }
 
 
-PackSource::Object::Object(File &f, const string &n, const string &k):
+PackSource::Object::Object(const File &f, const string &n, const string &k):
        file(f),
        name(n),
        keyword(k)