summaryrefslogtreecommitdiffstats
path: root/qt-models/diveimportedmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/diveimportedmodel.cpp')
-rw-r--r--qt-models/diveimportedmodel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index c5180dda8..504931b85 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -8,6 +8,7 @@ DiveImportedModel::DiveImportedModel(QObject *o) : QAbstractTableModel(o),
diveTable(nullptr),
sitesTable(nullptr)
{
+ connect(&thread, &QThread::finished, this, &DiveImportedModel::downloadThreadFinished);
}
int DiveImportedModel::columnCount(const QModelIndex&) const
@@ -129,6 +130,17 @@ void DiveImportedModel::clearTable()
endRemoveRows();
}
+void DiveImportedModel::downloadThreadFinished()
+{
+ repopulate(thread.table(), thread.sites());
+ emit downloadFinished();
+}
+
+void DiveImportedModel::startDownload()
+{
+ thread.start();
+}
+
void DiveImportedModel::repopulate(dive_table_t *table, struct dive_site_table *sites)
{
beginResetModel();