mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 00:49:55 +00:00
LTMPlot refresh optimisation
Only refresh when dateRange actually changes within dateRangeChanged() since it is a signal used by the HomeWindow to ask a replot when a tab is selected. Should speed up navigation across diary and home view.
This commit is contained in:
@@ -40,6 +40,7 @@ LTMWindow::LTMWindow(MainWindow *parent, bool useMetricUnits, const QDir &home)
|
||||
{
|
||||
main = parent;
|
||||
setInstanceName("Metric Window");
|
||||
plotted = DateRange(QDate(01,01,01), QDate(01,01,01));
|
||||
|
||||
// the plot
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
@@ -157,6 +158,7 @@ void
|
||||
LTMWindow::refreshPlot()
|
||||
{
|
||||
if (amVisible() == true) {
|
||||
plotted = myDateRange;
|
||||
ltmPlot->setData(&settings);
|
||||
dirty = false;
|
||||
}
|
||||
@@ -199,9 +201,13 @@ LTMWindow::metricSelected()
|
||||
|
||||
void
|
||||
LTMWindow::dateRangeChanged(DateRange range)
|
||||
{ Q_UNUSED( range )
|
||||
{
|
||||
if (!amVisible() && !dirty) return;
|
||||
|
||||
// we already plotted that date range
|
||||
if (range.from == plotted.from &&
|
||||
range.to == plotted.to) return;
|
||||
|
||||
settings.data = &results;
|
||||
settings.measures = &measures;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user