Add RideFileCache to RideItem

.. so available for current ride

.. and refreshed() when notifyDataChanged() is called

.. but not many classes call it!

.. we are moving to having the filecache read from the
   RideCache rather than straight from disk so we have an
   in-memory and persisted version.
This commit is contained in:
Mark Liversedge
2014-12-14 15:35:53 +00:00
parent df5fc26ac0
commit 9a486ae9c8
6 changed files with 61 additions and 24 deletions

View File

@@ -722,6 +722,19 @@ RideFileCache::refreshCache()
}
}
// if you already have a cache open and want
// to refresh it from in-memory data then refresh()
// does that
void RideFileCache::refresh(RideFile *file)
{
// set and refresh
if (file == NULL && ride == NULL) return;
if (file) ride = file;
// just call compute!
compute();
}
// this function is a candidate for supporting
// threaded calculations, each of the computes
// in here could go in its own thread. Users