mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Data Processors running on import are applied before the activity is added to RideCache and metrics are computed, this behavior is by design, likely to optimize resource usage on bulk import. So activityMetrics API is not available; a new getTag API was added for this case and setTag/delTag/hasTag changed to work in this context too. When the Python fix is executed on activities already in the cache either via Edit menu, Filters or other Python Fix changes are notified via the corresponding RideItem. Fixes #4095 [publish binaries]
36 lines
689 B
C++
36 lines
689 B
C++
#ifndef FIXPYRUNNER_H
|
|
#define FIXPYRUNNER_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
#include "FixPyScript.h"
|
|
#include "Context.h"
|
|
|
|
struct FixPyRunParams
|
|
{
|
|
Context *context;
|
|
RideFile *rideFile;
|
|
RideItem *rideItem;
|
|
QString script;
|
|
};
|
|
|
|
class FixPyRunner : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
FixPyRunner(Context *context = nullptr, RideFile *rideFile = nullptr, RideItem *rideItem = nullptr, bool useNewThread = true);
|
|
|
|
int run(QString source, QString scriptKey, QString &errText);
|
|
static void execScript(FixPyRunParams *params);
|
|
|
|
private:
|
|
Context *context;
|
|
RideFile *rideFile;
|
|
RideItem *rideItem;
|
|
bool useNewThread;
|
|
};
|
|
|
|
#endif // FIXPYRUNNER_H
|