summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-10-13 12:44:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-26 11:36:23 -0700
commit8dea2ada3bc9d0fcfbe1bb101ea079480dfdbe57 (patch)
tree12611a44e6f9efef1fa3ed8ce510d78b6841e63c /desktop-widgets/mapwidget.cpp
parent5c4d163a41c69538c8a658db82dde1a7486b6759 (diff)
downloadsubsurface-8dea2ada3bc9d0fcfbe1bb101ea079480dfdbe57.tar.gz
Undo: turn dive- and trip-fields into flags
The divesEdited signal sends the changed field as a parameter. Since some undo-commands change multiple fields, this led to numerous signals for a single command. This in turn would lead to multiple profile-reloads and statistic recalculations. Therefore, turn the enum into a bitfield. For simplicity, provide a constructor that takes classical flags and turns them into the bitfield. This is necessary because C-style named initialization is only supported on C++20 onward! Is this somewhat overengineered? Yes, maybe. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index ce98cc3cc..f8f9b0b7b 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -104,7 +104,7 @@ void MapWidget::coordinatesChanged(struct dive_site *ds, const location_t &locat
void MapWidget::divesChanged(const QVector<dive *> &, DiveField field)
{
- if (field == DiveField::DIVESITE)
+ if (field.divesite)
reload();
}