summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-09-06 22:15:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:22:27 -0700
commitc341bc53c302721144ad18e24824705ecf0636f7 (patch)
tree180e2b5714ec163359625dfeeaa75fef0ed44fdd /qt-models/divetripmodel.h
parentdd9af8e72e169256f2d3ea53cff9d5bbd8feb9fa (diff)
downloadsubsurface-c341bc53c302721144ad18e24824705ecf0636f7.tar.gz
Dive list: replace dive-id by dive pointer
The undo-system now guarantees that pointers to dives are stable throughout their lifetime. Therefore, replace the unique index by pointers. This is a small performance improvement, but much more importantly, it will make it more natural to transport a pointer to the dive inside QModelIndex's private pointer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.h')
-rw-r--r--qt-models/divetripmodel.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index 4164c5788..d33df2143 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -32,7 +32,7 @@ public:
};
QVariant data(int column, int role) const override;
- int diveId;
+ dive *d;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QString displayDate() const;
@@ -46,7 +46,7 @@ public:
QString displaySac() const;
QString displaySacWithUnit() const;
QString displayTags() const;
- int countPhotos(dive *dive) const;
+ int countPhotos() const;
int weight() const;
};