summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-25 21:23:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-01 07:48:43 -0700
commit89e0c3f46498ba3e0844514b6709a07c200a68df (patch)
tree8609c84130cb04180d9db4bb43f2dfc11cf563c3 /qt-models/divetripmodel.h
parent236f0512bec2946b35052abf637c7c8df97f34bf (diff)
downloadsubsurface-89e0c3f46498ba3e0844514b6709a07c200a68df.tar.gz
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>
Diffstat (limited to 'qt-models/divetripmodel.h')
-rw-r--r--qt-models/divetripmodel.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index fc17aff92..32a656bfe 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -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;
};