summaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-28 23:23:57 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-04 09:19:10 -0700
commit2a9a3dda20c47e74746fbfa3c6e5fd9ee919b2b3 (patch)
tree8ffc4ce0300c81d6d435ee98baba15688920faab /subsurface-helper.cpp
parent36d42a6a57e8f79de1c8daf01e77a811ef0392dc (diff)
downloadsubsurface-2a9a3dda20c47e74746fbfa3c6e5fd9ee919b2b3.tar.gz
Cleanup: turn GpsListModel into standard singleton
GpsListModel was one of those "special" singletons that could be created explicitly with new. This would make sense if a parameter were passed to the constructor. We only passed null, so one might as well turn that into a classical singleton with default constructor. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 1a0473b40..26e58ece9 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -97,9 +97,8 @@ void run_ui()
#endif // __APPLE__ not Q_OS_IOS
engine.addImportPath("qrc://imports");
DiveListSortModel *sortModel = new DiveListSortModel(0);
- GpsListModel gpsListModel;
QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(nullptr);
- gpsSortModel->setSourceModel(&gpsListModel);
+ gpsSortModel->setSourceModel(GpsListModel::instance());
gpsSortModel->setDynamicSortFilter(true);
gpsSortModel->setSortRole(GpsListModel::GpsWhenRole);
gpsSortModel->sort(0, Qt::DescendingOrder);