Add installedPackages() to Catalog.

This commit is contained in:
James Turner
2014-05-31 18:00:38 +01:00
parent e3ddcbe2dd
commit da6ab1eabc
2 changed files with 17 additions and 1 deletions

View File

@@ -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());

View File

@@ -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