From aef9d05d9a811fb716cb9b79507da2d635e8e485 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Date: Thu, 4 Jun 2015 00:13:09 -0300
Subject: [PATCH 14/25] 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>
---
 qt-models/divelocationmodel.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp
index cccc1a1..f7e3dc7 100644
--- a/qt-models/divelocationmodel.cpp
+++ b/qt-models/divelocationmodel.cpp
@@ -81,6 +81,7 @@ bool LocationInformationModel::removeRows(int row, int count, const QModelIndex
 	beginRemoveRows(QModelIndex(), row, row);
 	struct dive_site *ds = get_dive_site(row);
 	delete_dive_site(ds->uuid);
+	internalRowCount = dive_site_table.nr;
 	endRemoveRows();
 	return true;
 }
-- 
2.3.2 (Apple Git-55)

