]> git.mxchange.org Git - simgear.git/blobdiff - simgear/package/Root.cxx
Tweak HTTP code to always sleep.
[simgear.git] / simgear / package / Root.cxx
index 75eef3bb3c53c1dea737c1cf857daba1abef9f53..d5f275d154564248753092a610e98e8e5e066617 100644 (file)
@@ -68,10 +68,15 @@ SGPath Root::path() const
     return d->path;
 }
     
-void Root::setMaxAgeSeconds(int seconds)
+void Root::setMaxAgeSeconds(unsigned int seconds)
 {
     d->maxAgeSeconds = seconds;
 }
+    
+unsigned int Root::maxAgeSeconds() const
+{
+    return d->maxAgeSeconds;
+}
 
 void Root::setHTTPClient(HTTP::Client* aHTTP)
 {
@@ -207,7 +212,7 @@ void Root::refresh(bool aForce)
 {
     CatalogDict::iterator it = d->catalogs.begin();
     for (; it != d->catalogs.end(); ++it) {
-        if (aForce || (it->second->ageInSeconds() > d->maxAgeSeconds)) {
+        if (aForce || it->second->needsRefresh()) {
             it->second->refresh();
         }
     }