summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-04 16:35:24 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-04 11:49:23 -0700
commit69d437bc8675267eb71f6658b05991b4afdfb6fb (patch)
treec6fe0aadca8532205c661af56969fea9557d33dc /mobile-widgets
parent039ed38067a9d34c8625b2b8b260822c8f65d63e (diff)
downloadsubsurface-69d437bc8675267eb71f6658b05991b4afdfb6fb.tar.gz
undo/mobile: keep track of dive sites
When editing the dive site of a dive, the dive-table of the corresponding dive site was not properly updated by the undo commands. Try to get this right. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 177d0126e..0883d0389 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -799,7 +799,7 @@ static void setupDivesite(DiveSiteChange &res, struct dive *d, struct dive_site
res.location = location;
} else {
res.createdDs.reset(alloc_dive_site_with_name(locationtext));
- add_dive_to_dive_site(d, res.createdDs.get());
+ d->dive_site = res.createdDs.get();
}
res.changed = true;
}
@@ -920,8 +920,7 @@ bool QMLManager::checkLocation(DiveSiteChange &res, const DiveObjectHelper &myDi
res.changed = true;
ds = res.createdDs.get();
}
- unregister_dive_from_dive_site(d);
- add_dive_to_dive_site(d, ds);
+ d->dive_site = ds;
}
// now make sure that the GPS coordinates match - if the user changed the name but not
// the GPS coordinates, this still does the right thing as the now new dive site will