From: Mikko Rasa Date: Wed, 18 Nov 2015 20:45:18 +0000 (+0200) Subject: Use const sources in Collection X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5e677b2b3eeb2b3c41216a329f7b1363aade0aed;p=libs%2Fdatafile.git Use const sources in Collection The CollectionSource interface is entirely const anyway. --- diff --git a/source/collection.cpp b/source/collection.cpp index 3e9e4f1..9f135f0 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -92,7 +92,7 @@ CollectionItemTypeBase *Collection::get_type_for_item(const Variant &var) const return 0; } -void Collection::add_source(CollectionSource &s) +void Collection::add_source(const CollectionSource &s) { sources.push_back(&s); } diff --git a/source/collection.h b/source/collection.h index 50905ce..612a0af 100644 --- a/source/collection.h +++ b/source/collection.h @@ -83,7 +83,7 @@ public: private: typedef std::map ItemMap; typedef std::list TypeList; - typedef std::list SourceList; + typedef std::list SourceList; TypeList types; ItemMap items; @@ -264,7 +264,7 @@ private: protected: /** Adds a source for automatically loading items. Sources are consulted in the order they are added. */ - void add_source(CollectionSource &); + void add_source(const CollectionSource &); public: /** Opens a raw resource, without interpreting it as object data. Null is