mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
downloader: wait for download thread
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
eac59a79d8
commit
5e34531e32
3 changed files with 7 additions and 0 deletions
|
@ -36,4 +36,5 @@ void cliDownloader(const char *vendor, const char *product, const char *device)
|
||||||
|
|
||||||
// before we start, remember where the dive_table ended
|
// before we start, remember where the dive_table ended
|
||||||
diveImportedModel->startDownload();
|
diveImportedModel->startDownload();
|
||||||
|
diveImportedModel->waitForDownload();
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,11 @@ void DiveImportedModel::startDownload()
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiveImportedModel::waitForDownload()
|
||||||
|
{
|
||||||
|
thread.wait();
|
||||||
|
}
|
||||||
|
|
||||||
std::tuple<struct dive_table, struct dive_site_table, struct device_table> DiveImportedModel::consumeTables()
|
std::tuple<struct dive_table, struct dive_site_table, struct device_table> DiveImportedModel::consumeTables()
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
int numDives() const;
|
int numDives() const;
|
||||||
Q_INVOKABLE void recordDives(int flags = IMPORT_PREFER_IMPORTED | IMPORT_IS_DOWNLOADED);
|
Q_INVOKABLE void recordDives(int flags = IMPORT_PREFER_IMPORTED | IMPORT_IS_DOWNLOADED);
|
||||||
Q_INVOKABLE void startDownload();
|
Q_INVOKABLE void startDownload();
|
||||||
|
Q_INVOKABLE void waitForDownload();
|
||||||
|
|
||||||
DownloadThread thread;
|
DownloadThread thread;
|
||||||
public
|
public
|
||||||
|
|
Loading…
Reference in a new issue