Remove the loaded flag from PackSource files
authorMikko Rasa <tdb@tdb.fi>
Fri, 13 Nov 2015 08:53:35 +0000 (10:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 13 Nov 2015 08:53:35 +0000 (10:53 +0200)
It seems to be a relic from ancient times.  It also causes problems in
certain situations where it's desirable to remove and reload items.

source/packsource.cpp
source/packsource.h

index fe9e67d..1accdb0 100644 (file)
@@ -112,9 +112,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<IO::Base> in = file.open();
        Parser parser(*in, file.get_full_name());
@@ -165,8 +162,7 @@ PackSource::File::File(const Pack &p, const string &fn):
        filename(fn),
        offset(0),
        length(0),
-       collection(false),
-       loaded(false)
+       collection(false)
 { }
 
 RefPtr<IO::Seekable> PackSource::File::open() const
@@ -196,11 +192,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<Object>::const_iterator i=objects.begin(); i!=objects.end(); ++i)
index 7d61661..6912a40 100644 (file)
@@ -81,7 +81,6 @@ private:
                unsigned length;
                bool collection;
                std::list<Object> objects;
-               bool loaded;
 
        public:
                File(const Pack &, const std::string &);
@@ -92,9 +91,6 @@ private:
                std::string get_full_name() const;
                bool is_collection() const { return collection; }
 
-               void set_loaded();
-               bool is_loaded() const { return loaded; }
-
                void collect_objects(ObjectMap &) const;
        };