mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
dd9af8e72e
commit
c341bc53c3
2 changed files with 57 additions and 75 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue