summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-24 03:02:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-09-24 03:02:02 -0700
commit2d40172d78436b8aef3eab238faabe2ce3f9830f (patch)
tree9fb42e9d2b55ae57d60782d1f9330d7e2f61a0c0 /qt-ui/divelistview.cpp
parent023476a4a6591573a66ce38c8b0506f5de42954e (diff)
downloadsubsurface-2d40172d78436b8aef3eab238faabe2ce3f9830f.tar.gz
Much easier way to detect if more than one dive is selected
Instead of getting data from Qt just use our internal notion of the number of selected dive to decide if more than one dive is selected (and therefore if we need to show the 'merge dives' option in the context menu). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index a1436bf2d..ddd10e219 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -400,7 +400,7 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event)
}
if (d)
popup.addAction(tr("delete dive"), this, SLOT(deleteDive()));
- if (selectionModel()->selection().indexes().count() > 14)
+ if (amount_selected > 1)
popup.addAction(tr("merge selected dives"), this, SLOT(mergeDives()));
// "collapse all" really closes all trips,
// "collapse" keeps the trip with the selected dive open