]> git.mxchange.org Git - simgear.git/commitdiff
Add installedPackages() to Catalog.
authorJames Turner <zakalawe@mac.com>
Sat, 31 May 2014 17:00:38 +0000 (18:00 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 31 May 2014 17:00:38 +0000 (18:00 +0100)
simgear/package/Catalog.cxx
simgear/package/Catalog.hxx

index bc3df27bd93bf6330a2db6def36a3e0f7b11a6e7..70f4cc13a248106b59cce9aed6f6ef48d805df49 100644 (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());
index 236bed894ea6201c5af3e46a0860922c949e47cc..3f98fffb9aa215127d3f920599ac85ffb2806c01 100644 (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