summaryrefslogtreecommitdiffstats
path: root/core/divesite-helper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-13 11:52:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-13 21:41:41 -0400
commit8815f77ea086ba474df051144098b80739a0f3ae (patch)
treecd4546081961c4734ca850d72ce8c2f62ac91dc9 /core/divesite-helper.cpp
parent5d3967ce846ed4876abeb43ebe2d919064050ed6 (diff)
downloadsubsurface-8815f77ea086ba474df051144098b80739a0f3ae.tar.gz
Dive site: use own copy of taxonomy in dive-site-edit widget
The dive-site-edit widget uses a copy of the to-be-edited site to compare with old values. Generally, this seems overkill (the original dive-site can be used for such a comparison). But one place where it can't simply be removed is the taxonomy, because the widget needs a place to store the unsaved data. Change the code to use an explicit taxonomy structure instead of the one provided in the copy. This should ultimately allow removal of the latter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesite-helper.cpp')
-rw-r--r--core/divesite-helper.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/divesite-helper.cpp b/core/divesite-helper.cpp
index 55ebb3aba..bed0297ce 100644
--- a/core/divesite-helper.cpp
+++ b/core/divesite-helper.cpp
@@ -3,11 +3,11 @@
#include "pref.h"
#include "gettextfromc.h"
-QString constructLocationTags(struct dive_site *ds, bool for_maintab)
+QString constructLocationTags(struct taxonomy_data *taxonomy, bool for_maintab)
{
QString locationTag;
- if (!ds || !ds->taxonomy.nr)
+ if (!taxonomy->nr)
return locationTag;
/* Check if the user set any of the 3 geocoding categories */
@@ -33,9 +33,9 @@ QString constructLocationTags(struct dive_site *ds, bool for_maintab)
for (int i = 0; i < 3; i++) {
if (prefs.geocoding.category[i] == TC_NONE)
continue;
- for (int j = 0; j < ds->taxonomy.nr; j++) {
- if (ds->taxonomy.category[j].category == prefs.geocoding.category[i]) {
- QString tag = ds->taxonomy.category[j].value;
+ for (int j = 0; j < taxonomy->nr; j++) {
+ if (taxonomy->category[j].category == prefs.geocoding.category[i]) {
+ QString tag = taxonomy->category[j].value;
if (!tag.isEmpty()) {
locationTag += connector + tag;
connector = " / ";