aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-02-26 22:01:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-02-28 07:27:10 -0800
commitdd0ded1a9e70beebf44a3ca89d8ec20d95bccc52 (patch)
tree7f1fd8847b6526fb7ed6ec0bba47609a2762ee14 /core
parent3c2dd7f7c6144a9b586269fcae35fe58a38f037d (diff)
downloadsubsurface-dd0ded1a9e70beebf44a3ca89d8ec20d95bccc52.tar.gz
Cleanup: remove deletion of webservice dive sites
In the XML and git savers, unchanged webservice-dive sites were deleted. Since the webservice is not functional anymore, remove this code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/save-git.c19
-rw-r--r--core/save-xml.c18
2 files changed, 4 insertions, 33 deletions
diff --git a/core/save-git.c b/core/save-git.c
index 67a9cb55b..d7143e8db 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -883,24 +883,9 @@ static void save_divesites(git_repository *repo, struct dir *tree)
for (int i = 0; i < dive_site_table.nr; i++) {
struct membuffer b = { 0 };
struct dive_site *ds = get_dive_site(i);
- if (!is_dive_site_used(ds, false)) {
- /* Only write used dive sites */
+ /* Only write used dive sites */
+ if (!is_dive_site_used(ds, false))
continue;
- } else if (ds->name &&
- (strncmp(ds->name, "Auto-created dive", 17) == 0 ||
- strncmp(ds->name, "New Dive", 8) == 0)) {
- fprintf(stderr, "found an auto divesite %s\n", ds->name);
- // these are the two default names for sites from
- // the web service; if the site isn't used in any
- // dive (really? you didn't rename it?), delete it
- if (!is_dive_site_used(ds, false)) {
- if (verbose)
- fprintf(stderr, "Deleted unused auto-created dive site %s\n", ds->name);
- delete_dive_site(ds);
- i--; // since we just deleted that one
- continue;
- }
- }
struct membuffer site_file_name = { 0 };
put_format(&site_file_name, "Site-%08x", ds->uuid);
show_utf8(&b, "name ", ds->name, "\n");
diff --git a/core/save-xml.c b/core/save-xml.c
index 56504c4d3..fa71773c7 100644
--- a/core/save-xml.c
+++ b/core/save-xml.c
@@ -596,23 +596,9 @@ void save_dives_buffer(struct membuffer *b, const bool select_only, bool anonymi
put_format(b, "<divesites>\n");
for (i = 0; i < dive_site_table.nr; i++) {
struct dive_site *ds = get_dive_site(i);
- if (!is_dive_site_used(ds, false)) {
- /* Only write used dive sites */
+ /* Only write used dive sites */
+ if (!is_dive_site_used(ds, false))
continue;
- } else if (ds->name &&
- (strncmp(ds->name, "Auto-created dive", 17) == 0 ||
- strncmp(ds->name, "New Dive", 8) == 0)) {
- // these are the two default names for sites from
- // the web service; if the site isn't used in any
- // dive (really? you didn't rename it?), delete it
- if (!is_dive_site_used(ds, false)) {
- if (verbose)
- fprintf(stderr, "Deleted unused auto-created dive site %s\n", ds->name);
- delete_dive_site(ds);
- i--; // since we just deleted that one
- continue;
- }
- }
if (select_only && !is_dive_site_used(ds, true))
continue;