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
@ -378,7 +378,13 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user