aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-12-09 15:37:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-10 18:45:30 -0800
commit6ec82a3c80e0f362abc59a6df8ea793013f01c65 (patch)
treef381e928ccbc788b8302b0404f14bcb04af40de9 /qt-models/divetripmodel.h
parent0f417a3bc1f282b34509df1c9295197522344a55 (diff)
downloadsubsurface-6ec82a3c80e0f362abc59a6df8ea793013f01c65.tar.gz
Dive list: remove global pointer to DiveTrip model
This part of the code had that horrible pattern, where reseting the model would invalidate all pointers to the DiveTrip model. Internalize these complexities in the MultiFilterSortModel. All accesses are now performed via that proxy model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.h')
-rw-r--r--qt-models/divetripmodel.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index 66af0a32a..eed6913cf 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -18,12 +18,6 @@ struct DiveFilter;
// from DiveTripModelBase, which implements common features (e.g.
// definition of the column types, access of data from the core
// structures) and a common interface.
-//
-// The currently active model is set via DiveTripModelBase::resetModel().
-// This will create a new model. The model can be accessed with
-// DiveTripModelBase::instance(). A pointer obtained by instance()
-// is invalidated by a call to resetModel()! Yes, this is surprising
-// behavior, so care must be taken.
class DiveTripModelBase : public QAbstractItemModel {
Q_OBJECT
public:
@@ -63,15 +57,6 @@ public:
LIST,
};
- // Functions implemented by base class
- static DiveTripModelBase *instance();
-
- // Reset the model using the given layout. After this call instance() will return
- // a newly allocated object and the old model will have been destroyed! Thus, the
- // caller is responsible for removing all references to any previous model obtained
- // by instance().
- static void resetModel(Layout layout);
-
// Call after having set the model to be informed of the current selection.
void initSelection();