summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-28 23:31:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-04 09:19:10 -0700
commit3db50aedeaea94b7395fe6fcdb56bda9bee2f2cb (patch)
treeff4de197788d1122bba31f8d5cea67357a6ff3df /mobile-widgets
parent2a9a3dda20c47e74746fbfa3c6e5fd9ee919b2b3 (diff)
downloadsubsurface-3db50aedeaea94b7395fe6fcdb56bda9bee2f2cb.tar.gz
Cleanup: Turn DiveListSortModel into classical singleton
To make this class available from QMLManager, the run_ui() function would create the object and then set a pointer in QMLManager. It works, but is inconsistent with the rest of the code. Therefore, make it a classical singleton class, which is generated on demand. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index fcb25e4a5..f6c182a55 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -825,7 +825,7 @@ void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp)
process_loaded_dives();
DiveListModel::instance()->reload();
if (currentDiveTimestamp)
- setUpdateSelectedDive(dlSortModel->getIdxForId(get_dive_id_closest_to(currentDiveTimestamp)));
+ setUpdateSelectedDive(DiveListSortModel::instance()->getIdxForId(get_dive_id_closest_to(currentDiveTimestamp)));
appendTextToLog(QStringLiteral("%1 dives loaded").arg(dive_table.nr));
if (dive_table.nr == 0)
setStartPageText(tr("Cloud storage open successfully. No dives in dive list."));
@@ -2056,7 +2056,7 @@ void QMLManager::setFilter(const QString filterText)
QMetaObject::invokeMethod(qmlWindow, "showBusy");
QtConcurrent::run(QThreadPool::globalInstance(),
[=]{
- dlSortModel->setFilter(filterText);
+ DiveListSortModel::instance()->setFilter(filterText);
QMetaObject::invokeMethod(qmlWindow, "hideBusy");
});
}