mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: Make constructor of singletons private
This guarantees that they are actually singletons: there can only be one application-wide instantiation of these objects. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3db50aedea
commit
1e1f33c0f5
2 changed files with 4 additions and 5 deletions
|
@ -11,7 +11,6 @@ class DiveListSortModel : public QSortFilterProxyModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DiveListSortModel();
|
|
||||||
static DiveListSortModel *instance();
|
static DiveListSortModel *instance();
|
||||||
void setSourceModel(QAbstractItemModel *sourceModel);
|
void setSourceModel(QAbstractItemModel *sourceModel);
|
||||||
Q_INVOKABLE void reload();
|
Q_INVOKABLE void reload();
|
||||||
|
@ -25,6 +24,7 @@ public slots:
|
||||||
protected:
|
protected:
|
||||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
|
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
|
||||||
private:
|
private:
|
||||||
|
DiveListSortModel();
|
||||||
QString filterString;
|
QString filterString;
|
||||||
void updateFilterState();
|
void updateFilterState();
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,6 @@ class DiveListModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum DiveListRoles {
|
enum DiveListRoles {
|
||||||
DiveRole = Qt::UserRole + 1,
|
DiveRole = Qt::UserRole + 1,
|
||||||
DiveDateRole,
|
DiveDateRole,
|
||||||
|
@ -47,7 +46,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static DiveListModel *instance();
|
static DiveListModel *instance();
|
||||||
DiveListModel();
|
|
||||||
void addDive(const QList<dive *> &listOfDives);
|
void addDive(const QList<dive *> &listOfDives);
|
||||||
void addAllDives();
|
void addAllDives();
|
||||||
void insertDive(int i);
|
void insertDive(int i);
|
||||||
|
@ -65,6 +63,8 @@ public:
|
||||||
void resetInternalData();
|
void resetInternalData();
|
||||||
void clear(); // Clear all dives in core
|
void clear(); // Clear all dives in core
|
||||||
Q_INVOKABLE DiveObjectHelper at(int i);
|
Q_INVOKABLE DiveObjectHelper at(int i);
|
||||||
|
private:
|
||||||
|
DiveListModel();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIVELISTMODEL_H
|
#endif // DIVELISTMODEL_H
|
||||||
|
|
|
@ -10,7 +10,6 @@ class GpsListModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum GpsListRoles {
|
enum GpsListRoles {
|
||||||
GpsDateRole = Qt::UserRole + 1,
|
GpsDateRole = Qt::UserRole + 1,
|
||||||
GpsNameRole,
|
GpsNameRole,
|
||||||
|
@ -20,13 +19,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static GpsListModel *instance();
|
static GpsListModel *instance();
|
||||||
GpsListModel();
|
|
||||||
void clear();
|
void clear();
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QHash<int, QByteArray> roleNames() const;
|
QHash<int, QByteArray> roleNames() const;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
void update();
|
void update();
|
||||||
private:
|
private:
|
||||||
|
GpsListModel();
|
||||||
QVector<gpsTracker> m_gpsFixes;
|
QVector<gpsTracker> m_gpsFixes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue