From d3193abd0b028170b0228e34b3a518efc4b59a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 11 Oct 2017 22:39:42 +0200 Subject: [PATCH] Improved map view map init --- src/gui.cpp | 6 ++---- src/pathview.cpp | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui.cpp b/src/gui.cpp index 14e5fd94..30fd21c4 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -187,7 +187,7 @@ void GUI::loadMaps() } } - _map = _ml->maps().isEmpty() ? new EmptyMap(this) : _ml->maps().first(); + _map = new EmptyMap(this); } void GUI::loadPOIs() @@ -1711,9 +1711,7 @@ void GUI::readSettings() _showMapAction->setChecked(true); if (_ml->maps().count()) { int index = mapIndex(settings.value(CURRENT_MAP_SETTING).toString()); - _mapActions.at(index)->setChecked(true); - _map = _ml->maps().at(index); - _pathView->setMap(_map); + _mapActions.at(index)->trigger(); } settings.endGroup(); diff --git a/src/pathview.cpp b/src/pathview.cpp index c03f5a58..44d92184 100644 --- a/src/pathview.cpp +++ b/src/pathview.cpp @@ -43,8 +43,10 @@ PathView::PathView(Map *map, POI *poi, QWidget *parent) _scene->addItem(_mapScale); _map = map; - _poi = poi; + _map->load(); connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap())); + + _poi = poi; connect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI())); _units = Metric;