mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Invalidate incore cache when refreshing
If an incore cache of an aggregated RideFileCache is invalidated by a ride in the same period being edited it does not clear until the cache array is cleared (25 of them so likely to be never) or upon a restart. This fixes them being invalidated by refreshCache.
This commit is contained in:
@@ -297,6 +297,18 @@ RideFileCache::refreshCache()
|
||||
// all done now, phew
|
||||
cacheFile.close();
|
||||
|
||||
// invalidate any incore cache of aggregate
|
||||
// that contains this ride in its date range
|
||||
QDate date = ride->startTime().date();
|
||||
for (int i=0; i<main->cpxCache.count();) {
|
||||
if (date >= main->cpxCache.at(i)->start &&
|
||||
date <= main->cpxCache.at(i)->end) {
|
||||
delete main->cpxCache.at(i);
|
||||
main->cpxCache.removeAt(i);
|
||||
} else i++;
|
||||
}
|
||||
|
||||
|
||||
} else if (writeerror == false) {
|
||||
|
||||
// popup the first time...
|
||||
|
||||
Reference in New Issue
Block a user