aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-03 12:10:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commitd4a91a52fa54db951d09f9433b392d50183bf7ab (patch)
treee1a40541edcd23d0061ab6d263f65e13387a3959 /desktop-widgets/tab-widgets
parent48b8129137ed3db1c4b0940301c8bfc9662bcee3 (diff)
downloadsubsurface-d4a91a52fa54db951d09f9433b392d50183bf7ab.tar.gz
Map: reload on selection change directly
When changing the dive selection, we have to reload the map to show the correctly highlighted flags. Do this directly by hooking into the DiveListNotifier::divesChanged signal instead of indirectly via the MainTab. Moreover, on reload center on the highlighted dive sites. 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.cpp6
-rw-r--r--desktop-widgets/tab-widgets/maintab.h2
2 files changed, 0 insertions, 8 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 412ec899b..0638fbded 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -310,11 +310,6 @@ void MainTab::divesChanged(dive_trip *trip, const QVector<dive *> &dives, DiveFi
break;
case DiveField::DIVESITE:
updateDiveSite(current_dive);
- // Since we only show dive sites with a dive, a new dive site may have appeared or an old one disappeared.
- // Therefore reload the map widget.
- // TODO: Call this only if a site *actually* went from usage count 0 to 1 or 1 to 0.
- MapWidget::instance()->repopulateLabels();
- emit diveSiteChanged();
break;
case DiveField::TAGS:
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
@@ -593,7 +588,6 @@ void MainTab::updateDiveInfo()
if (verbose && current_dive && current_dive->dive_site)
qDebug() << "Set the current dive site:" << current_dive->dive_site->uuid;
- emit diveSiteChanged();
}
void MainTab::reload()
diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h
index c65d7fe32..cdb761afd 100644
--- a/desktop-widgets/tab-widgets/maintab.h
+++ b/desktop-widgets/tab-widgets/maintab.h
@@ -44,8 +44,6 @@ public:
void nextInputField(QKeyEvent *event);
void stealFocus();
-signals:
- void diveSiteChanged();
public
slots:
void divesChanged(dive_trip *trip, const QVector<dive *> &dives, DiveField field);