mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8e9e536ffd
commit
7e1ac2167b
4 changed files with 45 additions and 30 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue