1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-21 14:24:24 +02:00

Refactoring

This commit is contained in:
2020-12-10 22:02:09 +01:00
parent 0f03ef4af7
commit 22fb6071f7
4 changed files with 14 additions and 11 deletions

View File

@ -222,7 +222,7 @@ void MapView::addWaypoints(const QVector<Waypoint> &waypoints)
}
}
MapItem *MapView::addMap(Map *map)
MapItem *MapView::addMap(MapAction *map)
{
MapItem *mi = new MapItem(map, _map);
mi->setColor(_palette.nextColor());
@ -276,13 +276,8 @@ void MapView::loadMaps(const QList<MapAction *> &maps)
{
int zoom = _map->zoom();
for (int i = 0; i < maps.size(); i++) {
MapAction *a = maps.at(i);
Map *map = a->data().value<Map*>();
Q_ASSERT(map->isReady());
MapItem *mi = addMap(map);
connect(mi, SIGNAL(triggered()), a, SLOT(trigger()));
}
for (int i = 0; i < maps.size(); i++)
addMap(maps.at(i));
if (fitMapZoom() != zoom)
rescale();