diff --git a/simgear/package/Package.cxx b/simgear/package/Package.cxx index c9acdb6f..e572c4a0 100644 --- a/simgear/package/Package.cxx +++ b/simgear/package/Package.cxx @@ -34,7 +34,7 @@ namespace simgear { namespace pkg { Package::Package(const SGPropertyNode* aProps, CatalogRef aCatalog) : - m_catalog(aCatalog) + m_catalog(aCatalog.get()) { initWithProps(aProps); } @@ -235,6 +235,11 @@ std::string Package::id() const return m_id; } +CatalogRef Package::catalog() const +{ + return {m_catalog}; +} + std::string Package::qualifiedId() const { return m_catalog->id() + "." + id(); diff --git a/simgear/package/Package.hxx b/simgear/package/Package.hxx index b274d408..dc6958a8 100644 --- a/simgear/package/Package.hxx +++ b/simgear/package/Package.hxx @@ -130,8 +130,7 @@ public: size_t fileSizeBytes() const; - CatalogRef catalog() const - { return m_catalog; } + CatalogRef catalog() const; bool matches(const SGPropertyNode* aFilter) const; @@ -236,7 +235,7 @@ private: SGPropertyNode_ptr m_props; std::string m_id; string_set m_tags; - CatalogRef m_catalog; + Catalog* m_catalog = nullptr; // non-owning ref, explicitly string_list m_variants; mutable function_list _install_cb;