diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-11 10:37:50 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-10 09:25:57 -0700 |
commit | 7e1ac2167bb531b54974c182f131af8b14c401b1 (patch) | |
tree | f6ce375ebb7cd1d6f8c559fbfa609c5d45867630 /subsurface-helper.cpp | |
parent | 8e9e536ffdac3c1d9a35331cc3a9073eac1de320 (diff) | |
download | subsurface-7e1ac2167bb531b54974c182f131af8b14c401b1.tar.gz |
mobile/divelist: create memory management class for models
Since we want to add a second model, but not have to manage two models
everywhere, create a class MobileModels that contains both of the models. When
calling reset() on that class, it will reset both of the models, etc.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r-- | subsurface-helper.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index d230eacb8..44676eb74 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -103,10 +103,9 @@ void run_ui() gpsSortModel->setSortRole(GpsListModel::GpsWhenRole); gpsSortModel->sort(0, Qt::DescendingOrder); QQmlContext *ctxt = engine.rootContext(); - MobileListModel *mlm(MobileListModel::instance()); - ctxt->setContextProperty("diveModel", mlm); ctxt->setContextProperty("gpsModel", gpsSortModel); ctxt->setContextProperty("vendorList", vendorList); + ctxt->setContextProperty("diveModel", MobileModels::instance()->listModel()); set_non_bt_addresses(); ctxt->setContextProperty("connectionListModel", &connectionListModel); |