mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: make DiveTripModel a global object
DiveTripModel (the model describing the dive-list) was destroyed and recreated on every reset of the list. This seems excessive. Instead - in analogy to most other models - make it a single global object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
236f0512be
commit
89e0c3f464
7 changed files with 31 additions and 28 deletions
|
|
@ -93,6 +93,7 @@ public:
|
|||
CURRENT
|
||||
};
|
||||
|
||||
static DiveTripModel *instance();
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
|
|
@ -102,7 +103,6 @@ public:
|
|||
|
||||
private:
|
||||
void setupModelData();
|
||||
QMap<dive_trip_t *, TripItem *> trips;
|
||||
Layout currentLayout;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue