diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-31 23:17:04 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-06 11:48:47 -0700 |
commit | 9322092e415946e212f94b3e0a4e330f4b7c07d6 (patch) | |
tree | 65e00af455a252f0ff35f4c80c0b3106c2ead214 /map-widget | |
parent | 4dd86cc205dd71bf1ee484f5dc8bfa3bccd94a59 (diff) | |
download | subsurface-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 'map-widget')
0 files changed, 0 insertions, 0 deletions