summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-19 18:48:23 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-06 13:58:09 -0700
commit4374605c1295ede804d1ae1355094f8a3e0429e9 (patch)
treec1ab60086a08627a8b3d10f25aef14339e5bc792 /core
parent6ae2d36e381b4f676eb9d8c0e06245989ef16383 (diff)
downloadsubsurface-4374605c1295ede804d1ae1355094f8a3e0429e9.tar.gz
undo: make adding of pictures undoable
This one is a bit hairy, because two things might happen if the picture has a geo location: - A dive gets a newly generated dive site set. - The dive site of a dive is edited. Therefore the undo command has to store keep track of that. Oh my. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c14
-rw-r--r--core/dive.h2
2 files changed, 0 insertions, 16 deletions
diff --git a/core/dive.c b/core/dive.c
index d5ffc162b..b64b3ff01 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -3497,20 +3497,6 @@ void set_git_prefs(const char *prefs)
git_prefs.pp_graphs.po2 = 1;
}
-void dive_set_geodata_from_picture(struct dive *dive, struct picture *picture, struct dive_site_table *table)
-{
- struct dive_site *ds = dive->dive_site;
- if (!dive_site_has_gps_location(ds) && has_location(&picture->location)) {
- if (ds) {
- ds->location = picture->location;
- } else {
- ds = create_dive_site_with_gps("", &picture->location, table);
- add_dive_to_dive_site(dive, ds);
- invalidate_dive_cache(dive);
- }
- }
-}
-
/* clones a dive and moves given dive computer to front */
struct dive *make_first_dc(const struct dive *d, int dc_number)
{
diff --git a/core/dive.h b/core/dive.h
index 2113c2a9c..a7bd4c447 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -204,8 +204,6 @@ extern enum divemode_t get_current_divemode(const struct divecomputer *dc, int t
extern struct event *get_next_divemodechange(const struct event **evd, bool update_pointer);
extern enum divemode_t get_divemode_at_time(const struct divecomputer *dc, int dtime, const struct event **ev_dmc);
-extern void dive_set_geodata_from_picture(struct dive *dive, struct picture *picture, struct dive_site_table *table);
-
extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx);
extern int explicit_first_cylinder(const struct dive *dive, const struct divecomputer *dc);
extern int get_depth_at_time(const struct divecomputer *dc, unsigned int time);