1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 14:53:21 +02:00

Graphtab->mapview connections can be permanent

(no need to recreate them on every graph change)
This commit is contained in:
Martin Tůma 2021-02-23 23:12:14 +01:00
parent 48dcc6655b
commit ddc0e60517

View File

@ -679,8 +679,9 @@ void GUI::createGraphTabs()
_tabs.append(new TemperatureGraph(_graphTabWidget));
_tabs.append(new GearRatioGraph(_graphTabWidget));
connect(_tabs.first(), SIGNAL(sliderPositionChanged(qreal)), _mapView,
SLOT(setMarkerPosition(qreal)));
for (int i = 0; i < _tabs.size(); i++)
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), _mapView,
SLOT(setMarkerPosition(qreal)));
}
void GUI::createStatusBar()
@ -1726,17 +1727,11 @@ void GUI::graphChanged(int index)
return;
GraphTab *gt = static_cast<GraphTab*>(_graphTabWidget->widget(index));
_mapView->setGraph(_tabs.indexOf(gt));
if (_lastGraphTab)
disconnect(_lastGraphTab, SIGNAL(sliderPositionChanged(qreal)),
_mapView, SLOT(setMarkerPosition(qreal)));
connect(gt, SIGNAL(sliderPositionChanged(qreal)), _mapView,
SLOT(setMarkerPosition(qreal)));
if (_lastGraphTab)
gt->setSliderPosition(_lastGraphTab->sliderPosition());
_lastGraphTab = gt;
}