summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/divesite.c28
-rw-r--r--core/divesite.h1
2 files changed, 16 insertions, 13 deletions
diff --git a/core/divesite.c b/core/divesite.c
index 2f199f596..159ac4d40 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -245,20 +245,8 @@ bool dive_site_is_empty(struct dive_site *ds)
ds->longitude.udeg == 0;
}
-void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
+void copy_dive_site_taxonomy(struct dive_site *orig, struct dive_site *copy)
{
- free(copy->name);
- free(copy->notes);
- free(copy->country);
- free(copy->description);
-
- copy->latitude = orig->latitude;
- copy->longitude = orig->longitude;
- copy->name = copy_string(orig->name);
- copy->notes = copy_string(orig->notes);
- copy->description = copy_string(orig->description);
- copy->country = copy_string(orig->country);
- copy->uuid = orig->uuid;
if (orig->taxonomy.category == NULL) {
free_taxonomy(&copy->taxonomy);
} else {
@@ -275,6 +263,20 @@ void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
copy->taxonomy.nr = orig->taxonomy.nr;
}
}
+void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
+{
+ free(copy->name);
+ free(copy->notes);
+ free(copy->description);
+
+ copy->latitude = orig->latitude;
+ copy->longitude = orig->longitude;
+ copy->name = copy_string(orig->name);
+ copy->notes = copy_string(orig->notes);
+ copy->description = copy_string(orig->description);
+ copy->uuid = orig->uuid;
+ copy_dive_site_taxonomy(orig, copy);
+}
static void merge_string(char **a, char **b)
{
diff --git a/core/divesite.h b/core/divesite.h
index dc041d355..452a27927 100644
--- a/core/divesite.h
+++ b/core/divesite.h
@@ -65,6 +65,7 @@ uint32_t get_dive_site_uuid_by_gps(degrees_t latitude, degrees_t longitude, stru
uint32_t get_dive_site_uuid_by_gps_and_name(char *name, degrees_t latitude, degrees_t longitude);
uint32_t get_dive_site_uuid_by_gps_proximity(degrees_t latitude, degrees_t longitude, int distance, struct dive_site **dsp);
bool dive_site_is_empty(struct dive_site *ds);
+void copy_dive_site_taxonomy(struct dive_site *orig, struct dive_site *copy);
void copy_dive_site(struct dive_site *orig, struct dive_site *copy);
void merge_dive_site(struct dive_site *a, struct dive_site *b);
void clear_dive_site(struct dive_site *ds);