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>
This commit is contained in:
Berthold Stoeger 2019-09-28 23:31:40 +02:00 committed by Dirk Hohndel
parent 2a9a3dda20
commit 3db50aedea
4 changed files with 12 additions and 7 deletions

View file

@ -11,7 +11,8 @@ class DiveListSortModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
DiveListSortModel(QObject *parent = 0);
DiveListSortModel();
static DiveListSortModel *instance();
void setSourceModel(QAbstractItemModel *sourceModel);
Q_INVOKABLE void reload();
Q_INVOKABLE QString tripTitle(const QString &trip);