From 6febe22b6b0b03a99a2b1f08df8e75f43f5ba867 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 9 Dec 2018 18:56:51 +0100 Subject: Cleanup: remove DiveImportedModel::setImportedDivesIndexes() This function resets the DiveImportedModel. It takes two arguments: first and last index. All callers passed in 0 and number-of dives anyway, so remove the arguments. Since this now does the same as repopulate(), merge the two functions. Moreover, implement Qt-model semantics by using a beginResetModel()/endResetModel() pair. This simplifies the code. Signed-off-by: Berthold Stoeger --- desktop-widgets/downloadfromdivecomputer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'desktop-widgets/downloadfromdivecomputer.cpp') diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 3c70d8686..e88817cc8 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -492,10 +492,7 @@ void DownloadFromDCWidget::onDownloadThreadFinished() } ui.downloadCancelRetryButton->setText(tr("Retry download")); ui.downloadCancelRetryButton->setEnabled(true); - // regardless, if we got dives, we should show them to the user - if (downloadTable.nr) { - diveImportedModel->setImportedDivesIndexes(0, downloadTable.nr - 1); - } + diveImportedModel->repopulate(); } void DownloadFromDCWidget::on_cancel_clicked() -- cgit v1.2.3-70-g09d2