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>
This commit is contained in:
Dirk Hohndel 2013-09-24 03:02:02 -07:00
parent 023476a4a6
commit 2d40172d78

View file

@ -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