aboutsummaryrefslogtreecommitdiffstats
path: root/smtk-import
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-03 18:39:12 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit31291b1c56bf418732cf6ef52550aada492eff9b (patch)
tree4ff9e70839ced99fab1d13b7a38d43ece8171f4f /smtk-import
parentac1602f5125caae322e3e819a7c622b0be9feca1 (diff)
downloadsubsurface-31291b1c56bf418732cf6ef52550aada492eff9b.tar.gz
Dive site: set UUID only on save or load
Since the UUID will be overwritten on save and is only used on save and load, set it only on save or load. For other created dive sites, leave the UUID field uninitialized. This means that the UUID will change between saves. Let's see how the git saver handles that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'smtk-import')
-rw-r--r--smtk-import/smartrak.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c
index b33afb43c..67bf1fd6e 100644
--- a/smtk-import/smartrak.c
+++ b/smtk-import/smartrak.c
@@ -315,7 +315,7 @@ static void smtk_wreck_site(MdbHandle *mdb, char *site_idx, struct dive_site *ds
* Location format:
* | Idx | Text | Province | Country | Depth |
*/
-static void smtk_build_location(MdbHandle *mdb, char *idx, timestamp_t when, struct dive_site **location)
+static void smtk_build_location(MdbHandle *mdb, char *idx, struct dive_site **location)
{
MdbTableDef *table;
MdbColumn *col[MDB_MAX_COLS];
@@ -376,9 +376,9 @@ static void smtk_build_location(MdbHandle *mdb, char *idx, timestamp_t when, str
ds = get_dive_site_by_name(str, &dive_site_table);
if (!ds) {
if (!has_location(&loc))
- ds = create_dive_site(str, when, &dive_site_table);
+ ds = create_dive_site(str, &dive_site_table);
else
- ds = create_dive_site_with_gps(str, &loc, when, &dive_site_table);
+ ds = create_dive_site_with_gps(str, &loc, &dive_site_table);
}
*location = ds;
smtk_free(bound_values, table->num_cols);
@@ -1063,7 +1063,7 @@ void smartrak_import(const char *file, struct dive_table *divetable)
smtkdive->visibility = strtod(col[coln(VISIBILITY)]->bind_ptr, NULL) > 25 ? 5 : lrint(strtod(col[13]->bind_ptr, NULL) / 5);
smtkdive->weightsystem[0].weight.grams = lrint(strtod(col[coln(WEIGHT)]->bind_ptr, NULL) * 1000);
smtkdive->suit = copy_string(suit_list[atoi(col[coln(SUITIDX)]->bind_ptr) - 1]);
- smtk_build_location(mdb_clon, col[coln(SITEIDX)]->bind_ptr, smtkdive->when, &smtkdive->dive_site);
+ smtk_build_location(mdb_clon, col[coln(SITEIDX)]->bind_ptr, &smtkdive->dive_site);
smtkdive->buddy = smtk_locate_buddy(mdb_clon, col[0]->bind_ptr, buddy_list);
smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Type", "TypeRelation", type_list, true);
smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Activity", "ActivityRelation", activity_list, false);