Correctly decrease the number of rows in the dive_site model

We were removing the dive site, but forgetting to decrease the amount of
rowCount, leading to crashes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-04 00:13:09 -03:00 committed by Dirk Hohndel
parent 537dcb15e0
commit efeca58474

View file

@ -85,6 +85,7 @@ bool LocationInformationModel::removeRows(int row, int count, const QModelIndex
struct dive_site *ds = get_dive_site(row);
if (ds)
delete_dive_site(ds->uuid);
internalRowCount = dive_site_table.nr;
endRemoveRows();
return true;
}