mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Always save taxonomy data, even if disabled in the prefs
Otherwise, if one of the systems used with cloud storage doesn't have the preference for geo encoding enabled, the taxonomy data will be lost. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0bb65a17cb
commit
a081ffe48e
2 changed files with 7 additions and 8 deletions
13
save-git.c
13
save-git.c
|
@ -900,14 +900,13 @@ static void save_divesites(git_repository *repo, struct dir *tree)
|
||||||
show_utf8(&b, "description ", ds->description, "\n");
|
show_utf8(&b, "description ", ds->description, "\n");
|
||||||
show_utf8(&b, "notes ", ds->notes, "\n");
|
show_utf8(&b, "notes ", ds->notes, "\n");
|
||||||
show_gps(&b, ds->latitude, ds->longitude);
|
show_gps(&b, ds->latitude, ds->longitude);
|
||||||
if (prefs.geocoding.enable_geocoding)
|
for (int j = 0; j < ds->taxonomy.nr; j++) {
|
||||||
for (int j = 0; j < ds->taxonomy.nr; j++) {
|
struct taxonomy *t = &ds->taxonomy.category[j];
|
||||||
struct taxonomy *t = &ds->taxonomy.category[j];
|
if (t->category != TC_NONE && t->value) {
|
||||||
if (t->category != TC_NONE && t->value) {
|
put_format(&b, "geo cat %d origin %d ", t->category, t->origin);
|
||||||
put_format(&b, "geo cat %d origin %d ", t->category, t->origin);
|
show_utf8(&b, "", t->value, "\n" );
|
||||||
show_utf8(&b, "", t->value, "\n" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
blob_insert(repo, subdir, &b, mb_cstring(&site_file_name));
|
blob_insert(repo, subdir, &b, mb_cstring(&site_file_name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,7 +533,7 @@ void save_dives_buffer(struct membuffer *b, const bool select_only)
|
||||||
}
|
}
|
||||||
show_utf8(b, ds->description, " description='", "'", 1);
|
show_utf8(b, ds->description, " description='", "'", 1);
|
||||||
show_utf8(b, ds->notes, " notes='", "'", 1);
|
show_utf8(b, ds->notes, " notes='", "'", 1);
|
||||||
if (prefs.geocoding.enable_geocoding && ds->taxonomy.nr) {
|
if (ds->taxonomy.nr) {
|
||||||
put_format(b, ">\n");
|
put_format(b, ">\n");
|
||||||
for (int j = 0; j < ds->taxonomy.nr; j++) {
|
for (int j = 0; j < ds->taxonomy.nr; j++) {
|
||||||
struct taxonomy *t = &ds->taxonomy.category[j];
|
struct taxonomy *t = &ds->taxonomy.category[j];
|
||||||
|
|
Loading…
Reference in a new issue