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()
|
void DiveListView::deleteDive()
|
||||||
{
|
{
|
||||||
int i, nr;
|
int i;
|
||||||
struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value<void*>();
|
struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value<void*>();
|
||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
|
@ -592,9 +592,6 @@ void DiveListView::deleteDive()
|
||||||
lastDiveNr = i;
|
lastDiveNr = i;
|
||||||
}
|
}
|
||||||
if (amount_selected == 0) {
|
if (amount_selected == 0) {
|
||||||
if (i > 0)
|
|
||||||
select_dive(nr - 1);
|
|
||||||
else
|
|
||||||
mainWindow()->cleanUpEmpty();
|
mainWindow()->cleanUpEmpty();
|
||||||
}
|
}
|
||||||
mark_divelist_changed(TRUE);
|
mark_divelist_changed(TRUE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue