mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4eab1cce20
commit
f7efc07817
1 changed files with 2 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue