From f7efc0781738b9d6a9128f6e66bfc9b47c912910 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sat, 30 Nov 2013 13:07:58 +0100 Subject: Remove use of uninitialized variable nr nr was used but never initialized. Also, the code removed used select_dive had likely just been forgotten to be removed when the correct code using selectDive() was added a little later in the function. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index dccbccc8f..2e0811b63 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -575,7 +575,7 @@ void DiveListView::addToTripAbove() void DiveListView::deleteDive() { - int i, nr; + int i; struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value(); if (!d) return; @@ -592,10 +592,7 @@ void DiveListView::deleteDive() lastDiveNr = i; } if (amount_selected == 0) { - if (i > 0) - select_dive(nr - 1); - else - mainWindow()->cleanUpEmpty(); + mainWindow()->cleanUpEmpty(); } mark_divelist_changed(TRUE); mainWindow()->refreshDisplay(); -- cgit v1.2.3-70-g09d2