From: James Turner Date: Sat, 31 May 2014 17:00:38 +0000 (+0100) Subject: Add installedPackages() to Catalog. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=da6ab1eabce65919f3201df7c01a7c7dfce54443;p=simgear.git Add installedPackages() to Catalog. --- diff --git a/simgear/package/Catalog.cxx b/simgear/package/Catalog.cxx index bc3df27b..70f4cc13 100644 --- a/simgear/package/Catalog.cxx +++ b/simgear/package/Catalog.cxx @@ -198,6 +198,17 @@ Catalog::packagesNeedingUpdate() const return r; } +PackageList +Catalog::installedPackages() const +{ + PackageList r; + BOOST_FOREACH(PackageRef p, m_packages) { + if (p->isInstalled()) { + r.push_back(p); + } + } +} + void Catalog::refresh() { Downloader* dl = new Downloader(this, url()); diff --git a/simgear/package/Catalog.hxx b/simgear/package/Catalog.hxx index 236bed89..3f98fffb 100644 --- a/simgear/package/Catalog.hxx +++ b/simgear/package/Catalog.hxx @@ -72,7 +72,12 @@ public: * filter consists of required / minimum values, AND-ed together. */ PackageList packagesMatching(const SGPropertyNode* aFilter) const; - + + /** + * packages which are locally installed + */ + PackageList installedPackages() const; + /** * retrieve all the packages in the catalog which are installed * and have a pendig update