From cafc7e4b1338156c9a3294a8f1037b5a31fffdbb Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 10 Feb 2014 14:41:59 -0200 Subject: Clear the data when the model resets. This patch does a few things: 1 - reset the model when user closes the dive file 2 - connects the 'rowsAboutToBeRemoved' in a way that the graphics can remove their polygons too 3 - adds a 'clear' virtual method so items that don't follow the rules can clean themseves up. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-ui/profile/diveplotdatamodel.cpp') diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 2f81999c2..3c89e81e7 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -99,6 +99,7 @@ void DivePlotDataModel::clear() { if (rowCount() != 0) { beginRemoveRows(QModelIndex(), 0, rowCount() - 1); + pInfo.nr = 0; endRemoveRows(); } } -- cgit v1.2.3-70-g09d2