mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Withings, Summary + Cache refresh update
.. when downloading withings data the cache is refreshed .. when the cache refreshes it notifies the *current* ride changes if it is refreshed .. ridesummary has been updated to process rideChanged() signals.
This commit is contained in:
@@ -128,7 +128,7 @@ RideCache::itemChanged()
|
||||
if (item == context->currentRideItem()) {
|
||||
|
||||
// in lieu of chart refresh code
|
||||
//qDebug()<<"RIDE CHANGED:"<<item->fileName;
|
||||
qDebug()<<"RIDE CHANGED:"<<item->fileName;
|
||||
|
||||
context->notifyRideChanged(item);
|
||||
}
|
||||
@@ -317,7 +317,13 @@ void
|
||||
itemRefresh(RideItem *&item)
|
||||
{
|
||||
// need parser to be reentrant !item->refresh();
|
||||
if (item->isstale) item->refresh();
|
||||
if (item->isstale) {
|
||||
item->refresh();
|
||||
|
||||
// and trap changes during refresh to current ride
|
||||
if (item == item->context->currentRideItem())
|
||||
item->context->notifyRideChanged(item);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -59,7 +59,6 @@ class RideItem : public QObject
|
||||
|
||||
|
||||
QStringList errors_;
|
||||
Context *context; // to notify widgets when date/time changes
|
||||
|
||||
unsigned long metaCRC();
|
||||
|
||||
@@ -76,6 +75,7 @@ class RideItem : public QObject
|
||||
|
||||
public:
|
||||
|
||||
Context *context; // to notify widgets when date/time changes
|
||||
bool isdirty; // ride data has changed and needs saving
|
||||
bool isstale; // metric data is out of date and needs recomputing
|
||||
bool isedit; // is being edited at the moment
|
||||
|
||||
@@ -103,6 +103,7 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) :
|
||||
if (ridesummary) {
|
||||
|
||||
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideItemChanged()));
|
||||
connect(context, SIGNAL(rideChanged(RideItem*)), this, SLOT(refresh()));
|
||||
connect(context->athlete, SIGNAL(zonesChanged()), this, SLOT(refresh()));
|
||||
connect(context, SIGNAL(intervalsChanged()), this, SLOT(refresh()));
|
||||
connect(context, SIGNAL(compareIntervalsStateChanged(bool)), this, SLOT(compareChanged()));
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "WithingsDownload.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Athlete.h"
|
||||
#include "RideCache.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
WithingsDownload::WithingsDownload(Context *context) : context(context)
|
||||
@@ -79,7 +80,8 @@ WithingsDownload::downloadFinished(QNetworkReply *reply)
|
||||
withingsJSON.close();
|
||||
}
|
||||
|
||||
//XXXREFRESH context->athlete->metricDB->refreshMetrics(context->athlete->withings().first().when);
|
||||
// apply across the ride items
|
||||
context->athlete->rideCache->refresh();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user