summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-07 22:10:41 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-07 22:10:41 +0800
commit409c2e9bcfd8a3f328e21b511919cc70629cc1ab (patch)
treecfd247a14fe71ea2d6c1f985673d87b671074f2b /qt-ui/models.h
parenta8db19f54829880c222b749394c70cef31d5fb6f (diff)
downloadsubsurface-409c2e9bcfd8a3f328e21b511919cc70629cc1ab.tar.gz
Not everything can be done with the diveId
In commit c3fe1a9e9f79 ("Get rid of pointers to dive structures in the UI") I was a bit too aggressive moving away from pointers to dives. This is only needed for pointers that are held across operations that could change the dive_table. I figured that it wouldn't hurt to get rid of some more pointers as well, but it turns out I was wrong. The current dive that we store in the Cylinder and Weight models can be a dive that isn't in the dive_table at all: the multiEditEquipmentPlaceholder. And when using the diveId we end up finding the original dive in the dive_table and therefore modify the wrong structure. This undoes two thirds of the above mentioned commit. Reported-and-analyzed-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index 1f1641e16..06dc66aa1 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -101,7 +101,7 @@ public slots:
void remove(const QModelIndex& index);
private:
- int currentId;
+ struct dive *current;
int rows;
};
@@ -130,7 +130,7 @@ public slots:
void remove(const QModelIndex& index);
private:
- int currentId;
+ struct dive *current;
int rows;
};