From 5e677b2b3eeb2b3c41216a329f7b1363aade0aed Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 18 Nov 2015 22:45:18 +0200 Subject: [PATCH] Use const sources in Collection The CollectionSource interface is entirely const anyway. --- source/collection.cpp | 2 +- source/collection.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.43.0