mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 02:26:16 +00:00
Fix 'cancelling divecomputer download'
When a download is canceled, discard the partially downloaded dives. Fixes #341 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6378bfd91e
commit
6fe692bde6
1 changed files with 7 additions and 1 deletions
|
@ -378,7 +378,13 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
|
||||||
} else {
|
} else {
|
||||||
process_dives(true, preferDownloaded());
|
process_dives(true, preferDownloaded());
|
||||||
}
|
}
|
||||||
} else {
|
} else if (currentState == CANCELLING || currentState == CANCELLED){
|
||||||
|
if (import_thread_cancelled) {
|
||||||
|
// walk backwards so we don't keep moving the dives
|
||||||
|
// down in the dive_table
|
||||||
|
for (int i = dive_table.nr - 1; i >= previousLast; i--)
|
||||||
|
delete_single_dive(i);
|
||||||
|
}
|
||||||
updateState(CANCELLED);
|
updateState(CANCELLED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue