summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-11-30 13:07:58 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-30 07:36:13 -0800
commitf7efc0781738b9d6a9128f6e66bfc9b47c912910 (patch)
tree2d716999eae355cbb3617b3bebefd474a8ff2b74 /qt-ui
parent4eab1cce20132bf98b9c269a9745378f3c829886 (diff)
downloadsubsurface-f7efc0781738b9d6a9128f6e66bfc9b47c912910.tar.gz
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 <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/divelistview.cpp7
1 files changed, 2 insertions, 5 deletions
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<void*>();
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();