From 31ee4dac65bd6e8b0c3583fc0245cc83a90542d5 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 17 Feb 2014 19:15:40 -0300 Subject: Make part of the context menu work (gas change event) The code of the context menu and the gas change event callback is mostly the same as the old profile, with minimum modifications, as this changes the order of the code on the callback to make it a bit saner (declare variables first, call code later). This also fixes a bug on the model that was not cleaning itself in the correct way after a call to clear. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui/profile/diveplotdatamodel.cpp') diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 700ca6503..111196588 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -100,6 +100,8 @@ void DivePlotDataModel::clear() if (rowCount() != 0) { beginRemoveRows(QModelIndex(), 0, rowCount() - 1); pInfo.nr = 0; + diveId = -1; + dcNr = -1; endRemoveRows(); } } -- cgit v1.2.3-70-g09d2