diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-08 21:16:40 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-08 13:29:51 -0700 |
commit | 0aef04352a3210a6024f860758af466ea774dd5e (patch) | |
tree | 8758b8080f172bb010f249950c3ebc7e225f8819 /desktop-widgets/tab-widgets | |
parent | 1c8b73b36f528bf8d2765a1c064980b1e2022650 (diff) | |
download | subsurface-0aef04352a3210a6024f860758af466ea774dd5e.tar.gz |
Map: zoom on dive sites when flipping through dive site list
The dive site list was connected to centerOnDiveSite(). Apparently,
the currently selected dive site should have been shown in the map.
Yet, this never worked, because the actual dive site of the selected
dive had precedence in centerOnDiveSite().
It seems that centerOnDiveSite() had actually to purposes:
1) center on the passed in dive site
2) center on the dive sites of the selected dives
Therefore, split this function in two separate functions for
each of these use-cases. This allows us to remove some pre-processor
magic (mobile vs. desktop) and to remove a parameter from the
MainTab::diveSiteChanged() signal.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 070184a86..b6ac56ed7 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -643,7 +643,7 @@ void MainTab::updateDiveInfo(bool clear) if (verbose) qDebug() << "Set the current dive site:" << displayed_dive.dive_site_uuid; - emit diveSiteChanged(get_dive_site_by_uuid(displayed_dive.dive_site_uuid)); + emit diveSiteChanged(); } void MainTab::addCylinder_clicked() @@ -1384,7 +1384,7 @@ void MainTab::on_location_diveSiteSelected() if (ui.location->text().isEmpty()) { displayed_dive.dive_site_uuid = 0; markChangedWidget(ui.location); - emit diveSiteChanged(0); + emit diveSiteChanged(); return; } else { if (ui.location->currDiveSiteUuid() != displayed_dive.dive_site_uuid) { diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index 31e3d14b0..238c060f8 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -59,7 +59,7 @@ public: signals: void addDiveFinished(); void dateTimeChanged(); - void diveSiteChanged(struct dive_site * ds); + void diveSiteChanged(); public slots: void addCylinder_clicked(); |