aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-31 23:17:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-06 11:48:47 -0700
commit9322092e415946e212f94b3e0a4e330f4b7c07d6 (patch)
tree65e00af455a252f0ff35f4c80c0b3106c2ead214 /qt-models/maplocationmodel.h
parent4dd86cc205dd71bf1ee484f5dc8bfa3bccd94a59 (diff)
downloadsubsurface-9322092e415946e212f94b3e0a4e330f4b7c07d6.tar.gz
Cleanup: simplify role handling in MapLocationModel
To connect a model to QML, one is supposed to provide a QHash<int, QByteArray> MapLocationModel::roleNames() function that returns a role -> attribute-name hash. That was realized by filling the hash in the constructor, storing it as a member variable, using static strings that were declared in the class-definition and defined in the translation unit. Adding a new role was a pain and the whole thing was totally pointless as the attribute names were used nowhere else and the roleNames() function is called only once. Simply do, what we do everywhere else: initialize the hash in the roleNames() function and use normal string literals. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/maplocationmodel.h')
-rw-r--r--qt-models/maplocationmodel.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h
index 4b2066186..ce1f999fb 100644
--- a/qt-models/maplocationmodel.h
+++ b/qt-models/maplocationmodel.h
@@ -18,12 +18,6 @@ class MapLocation : public QObject
Q_PROPERTY(QString name MEMBER m_name)
public:
- static const char *PROPERTY_NAME_COORDINATE;
- static const char *PROPERTY_NAME_DIVESITE;
- static const char *PROPERTY_NAME_NAME;
- static const char *PROPERTY_NAME_PIXMAP;
- static const char *PROPERTY_NAME_Z;
-
explicit MapLocation();
explicit MapLocation(struct dive_site *ds, QGeoCoordinate coord, QString name, bool selected);
@@ -86,7 +80,6 @@ private slots:
private:
QVector<MapLocation *> m_mapLocations;
- QHash<int, QByteArray> m_roles;
QVector<dive_site *> m_selectedDs;
signals: