Dowload: Deselect dives only if at least one dive was downloaded

On dive-download old dives are deselected and a new one is selected.
If no dives were downloaded, accordingly no dives were selected.
This deselect only dives if at least one dive was downloaded.

Fixes #1793

Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-15 23:31:38 +02:00 committed by Dirk Hohndel
parent 813c570524
commit 3c1002d7ef

View file

@ -523,9 +523,8 @@ void DownloadFromDCWidget::on_ok_clicked()
delete_dive_from_table(&downloadTable, j);
}
MainWindow::instance()->diveList->unselectDives();
if (downloadTable.nr > 0) {
MainWindow::instance()->diveList->unselectDives();
// remember the last downloaded dive (on most dive computers this will be the chronologically
// first new dive) and select it again after processing all the dives
int uniqId = downloadTable.dives[downloadTable.nr - 1]->id;