summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-19 18:40:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-20 21:23:16 -0700
commit4fe9b39cdbb5839830281820621059cefc26a03a (patch)
tree952d4b3449c32c644140e94f8da38cf389135955 /profile-widget
parentac590235c94fc2feb1f35a5cd290ea87f1a92044 (diff)
downloadsubsurface-4fe9b39cdbb5839830281820621059cefc26a03a.tar.gz
Core: let count_divecomputers() operate on an arbitrary dive
Currently, count_divecomputers only works on the current_dive. Instead, let it take a pointer to an arbitrary dive. This is in preparation for being smarter in the undo code concerning which dive computer to show on deletion. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index c233b2b44..90c6e37ce 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1430,13 +1430,13 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
parentItem = parentItem->parentItem();
}
if (isDCName) {
- if (dc_number == 0 && count_divecomputers() == 1)
+ if (dc_number == 0 && count_divecomputers(current_dive) == 1)
// nothing to do, can't delete or reorder
return;
// create menu to show when right clicking on dive computer name
if (dc_number > 0)
m.addAction(tr("Make first dive computer"), this, SLOT(makeFirstDC()));
- if (count_divecomputers() > 1) {
+ if (count_divecomputers(current_dive) > 1) {
m.addAction(tr("Delete this dive computer"), this, SLOT(deleteCurrentDC()));
m.addAction(tr("Split this dive computer into own dive"), this, SLOT(splitCurrentDC()));
}