]> git.tdb.fi Git - libs/datafile.git/commitdiff
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 fe9e67db6eabae37ae1b38278d68104b305f2739..1accdb0fc3a384c456f4535db23e164a89efb5b7 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 7d616614cff490690d73699f4a5b4f6a76a545f1..6912a40047edfb1110ef4d31ce867bb5bdceee4f 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;
        };