mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
media: give newly created dive sites a name
When adding a picture with GPS information, a dive site was added if the dive didn't have any. The dive site had the empty string as name, leading to a confusing UI experience. We could catch the empty string at numerous places and replace it by some dummy string. This commit goes the distinctly less invasive route and adds the dive site with the "unnamed dive site" string (translated to the user language) as name. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
57c4b7c9c1
commit
ab6cac9799
1 changed files with 2 additions and 1 deletions
|
@ -169,7 +169,8 @@ AddPictures::AddPictures(const std::vector<PictureListForAddition> &pictures) :
|
|||
struct dive_site *ds = p.d->dive_site;
|
||||
if (!ds) {
|
||||
// This dive doesn't yet have a dive site -> add a new dive site.
|
||||
dive_site *ds = alloc_dive_site_with_gps("", &it->location);
|
||||
QString name = Command::Base::tr("unnamed dive site");
|
||||
dive_site *ds = alloc_dive_site_with_gps(qPrintable(name), &it->location);
|
||||
sitesToAdd.emplace_back(ds);
|
||||
sitesToSet.push_back({ p.d, ds });
|
||||
} else if (!dive_site_has_gps_location(ds)) {
|
||||
|
|
Loading…
Reference in a new issue