diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-23 20:52:41 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-24 06:16:39 +0900 |
commit | 19b8c9a33ae8d29b189d06264d1e60c409373439 (patch) | |
tree | 3aa1726d61c46e98702baa84735aff312db73cc3 /profile-widget/qmlprofile.cpp | |
parent | 967f0e56d79c4c25e54619ef8f56770baa9edaa8 (diff) | |
download | subsurface-19b8c9a33ae8d29b189d06264d1e60c409373439.tar.gz |
Cleanup: Turn QMLProfile::diveId from QString to int
This property is used to render the profile of a given dive.
Weirdly, even though the diveId is an integer, it was stored
as a string. It is not clear why that is the case. Therefore,
turn into the more natural int and avoid unnecessary conversion.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/qmlprofile.cpp')
-rw-r--r-- | profile-widget/qmlprofile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp index 323dad6ce..2a92340b5 100644 --- a/profile-widget/qmlprofile.cpp +++ b/profile-widget/qmlprofile.cpp @@ -80,17 +80,17 @@ void QMLProfile::setMargin(int margin) m_margin = margin; } -QString QMLProfile::diveId() const +int QMLProfile::diveId() const { return m_diveId; } -void QMLProfile::setDiveId(const QString &diveId) +void QMLProfile::setDiveId(int diveId) { m_diveId = diveId; - struct dive *d = get_dive_by_uniq_id(m_diveId.toInt()); - if (m_diveId.toInt() < 1) + if (m_diveId < 0) return; + struct dive *d = get_dive_by_uniq_id(diveId); if (!d) return; if (verbose) |