mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
RideCache - send less load update notifications
To minimize overhead and avoid crashes on Windows Fixes #4471
This commit is contained in:
@@ -82,8 +82,12 @@ ride: '{' rideelement_list '}' {
|
||||
jc->api->writeRideLine(jc->item, jc->request, jc->response);
|
||||
#endif
|
||||
} else {
|
||||
double progress= double(jc->loading++) / double(jc->cache->rides().count()) * 100.0f;
|
||||
jc->context->notifyLoadProgress(jc->folder,progress);
|
||||
static double last = 0.0;
|
||||
double progress= round(double(jc->loading++) / double(jc->cache->rides().count()) * 100.0f);
|
||||
if (progress > last) {
|
||||
jc->context->notifyLoadProgress(jc->folder,progress);
|
||||
last = progress;
|
||||
}
|
||||
|
||||
// find entry and update it
|
||||
int index=jc->cache->find(&jc->item);
|
||||
|
||||
Reference in New Issue
Block a user