From: Mikko Rasa Date: Fri, 13 Nov 2015 08:53:35 +0000 (+0200) Subject: Remove the loaded flag from PackSource files X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b39ce68f12c30eedb272b65fe78baec5864d89ca;p=libs%2Fdatafile.git Remove the loaded flag from PackSource files 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. --- diff --git a/source/packsource.cpp b/source/packsource.cpp index fe9e67d..1accdb0 100644 --- a/source/packsource.cpp +++ b/source/packsource.cpp @@ -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 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 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::const_iterator i=objects.begin(); i!=objects.end(); ++i) diff --git a/source/packsource.h b/source/packsource.h index 7d61661..6912a40 100644 --- a/source/packsource.h +++ b/source/packsource.h @@ -81,7 +81,6 @@ private: unsigned length; bool collection; std::list 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; };