mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Handle dives with no samples
This occurs upon importing dives for example via CSV. Make sure the profile display is cleared when selecting such a dive rather than showing a different dive. Allow editing the profile for such a dive. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
876a09753a
commit
6b2e56e513
2 changed files with 5 additions and 3 deletions
|
@ -1512,7 +1512,7 @@ void MainWindow::on_actionImportDiveSites_triggered()
|
|||
void MainWindow::editCurrentDive()
|
||||
{
|
||||
// We only allow editing of the profile for manually added dives.
|
||||
if (!current_dive || !same_string(current_dive->dc.model, "manually added dive") || !userMayChangeAppState())
|
||||
if (!current_dive || (!same_string(current_dive->dc.model, "manually added dive") && current_dive->dc.samples) || !userMayChangeAppState())
|
||||
return;
|
||||
|
||||
// This shouldn't be possible, but let's make sure no weird "double editing" takes place.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue