diff options
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 2 | ||||
-rw-r--r-- | qt-models/diveimportedmodel.cpp | 5 | ||||
-rw-r--r-- | qt-models/diveimportedmodel.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index cb6af7bfd..484d15f83 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -272,7 +272,7 @@ void DownloadFromDCWidget::updateState(states state) markChildrenAsEnabled(); progress_bar_text = ""; } else { - if (diveImportedModel->thread.table()->nr != 0) + if (diveImportedModel->numDives() != 0) progress_bar_text = ""; ui.progressBar->setValue(100); markChildrenAsEnabled(); diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp index 6342972a7..1c9b0cfcd 100644 --- a/qt-models/diveimportedmodel.cpp +++ b/qt-models/diveimportedmodel.cpp @@ -175,6 +175,11 @@ std::pair<struct dive_table, struct dive_site_table> DiveImportedModel::consumeT return std::make_pair(dives, sites); } +int DiveImportedModel::numDives() const +{ + return diveTable->nr; +} + // Delete non-selected dives void DiveImportedModel::deleteDeselected() { diff --git a/qt-models/diveimportedmodel.h b/qt-models/diveimportedmodel.h index db0f813b2..468385f6a 100644 --- a/qt-models/diveimportedmodel.h +++ b/qt-models/diveimportedmodel.h @@ -23,6 +23,7 @@ public: QHash<int, QByteArray> roleNames() const; void deleteDeselected(); std::pair<struct dive_table, struct dive_site_table> consumeTables(); // Returns dives and sites and resets model. + int numDives() const; Q_INVOKABLE void recordDives(); Q_INVOKABLE void startDownload(); |