mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Dive site: don't auto delete unused dive sites
This feature will be replaced by. 1) An explicit purge empty dive sites feature. 2) Not allocating dummy dive sites for GPS coordinates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0e1b0cf1da
commit
f022a4a4d0
2 changed files with 1 additions and 7 deletions
|
@ -85,6 +85,7 @@ void DeleteDiveSites::undo()
|
|||
EditDiveSiteName::EditDiveSiteName(dive_site *dsIn, const QString &name) : ds(dsIn),
|
||||
value(name)
|
||||
{
|
||||
setText(tr("Edit dive site name"));
|
||||
}
|
||||
|
||||
bool EditDiveSiteName::workToBeDone()
|
||||
|
|
|
@ -855,18 +855,11 @@ void MainTab::acceptChanges()
|
|||
}
|
||||
|
||||
// update the dive site for the selected dives that had the same dive site as the current dive
|
||||
struct dive_site *oldDs = cd->dive_site;
|
||||
struct dive_site *newDs = nullptr;
|
||||
MODIFY_DIVES(selectedDives,
|
||||
if (mydive->dive_site == current_dive->dive_site)
|
||||
newDs = updateDiveSite(!newDs ? ui.location->currDiveSite() : newDs, mydive);
|
||||
);
|
||||
if (oldDs && !is_dive_site_used(oldDs, false)) {
|
||||
if (verbose)
|
||||
qDebug() << "delete now unused dive site" << (oldDs->name ? oldDs->name : "without name");
|
||||
delete_dive_site(oldDs, &dive_site_table);
|
||||
MapWidget::instance()->reload();
|
||||
}
|
||||
// the code above can change the correct uuid for the displayed dive site - and the
|
||||
// code below triggers an update of the display without re-initializing displayed_dive
|
||||
// so let's make sure here that our data is consistent now that we have handled the
|
||||
|
|
Loading…
Reference in a new issue