DiaryWindow::rideSelected - Ignore same activity

This method is called every time the chart is activated
and this change is intended to preserve the chart status
since the user could have navigated to a different date.
[publish binaries][skip travis]
This commit is contained in:
Alejandro Martinez
2025-05-14 16:33:59 -03:00
parent ba8dc873da
commit c1bb636db4
2 changed files with 5 additions and 3 deletions

View File

@@ -27,7 +27,7 @@
#include "HelpWhatsThis.h"
DiaryWindow::DiaryWindow(Context *context) :
GcChartWindow(context), context(context), active(false)
GcChartWindow(context), ride(nullptr), context(context), active(false)
{
setControls(NULL);
@@ -142,11 +142,12 @@ DiaryWindow::setDefaultView(int view)
void
DiaryWindow::rideSelected()
{
if (active) {
// ignore if already active or the selected activity has not changed
if (active || ride == myRideItem) {
return;
}
RideItem *ride = myRideItem;
ride = myRideItem;
// ignore if not active or null ride
if (!ride) {

View File

@@ -61,6 +61,7 @@ class DiaryWindow : public GcChartWindow
protected:
Context *context;
RideItem *ride;
QDateEdit *title;
QPushButton *prev, *next;