mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_same_dive_site() into dive_site_table class
This was the only dive_site_table function that accessed to global divelog, which is odd. Make it consistent with the others. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4ac2486a23
commit
512eada468
4 changed files with 7 additions and 10 deletions
|
@ -99,10 +99,9 @@ ImportDiveSites::ImportDiveSites(dive_site_table sites, const QString &source)
|
|||
setText(Command::Base::tr("import dive sites from %1").arg(source));
|
||||
|
||||
for (auto &new_ds: sites) {
|
||||
// Don't import dive sites that already exist. Currently we only check for
|
||||
// the same name. We might want to be smarter here and merge dive site data, etc.
|
||||
struct dive_site *old_ds = get_same_dive_site(*new_ds);
|
||||
if (old_ds)
|
||||
// Don't import dive sites that already exist.
|
||||
// We might want to be smarter here and merge dive site data, etc.
|
||||
if (divelog.sites->get_same(*new_ds))
|
||||
continue;
|
||||
sitesToAdd.push_back(std::move(new_ds));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue