diff options
author | Danilo Cesar Lemes de Paula <danilo.eu@gmail.com> | 2013-09-17 18:36:22 -0300 |
---|---|---|
committer | Danilo Cesar Lemes de Paula <danilo.eu@gmail.com> | 2013-09-17 18:46:02 -0300 |
commit | 608209fff23417f77526bef836bb505bc05c7eff (patch) | |
tree | 266df7dc434cd0b343aadf6ed3cc9775fc4c7781 /qt-ui/downloadfromdivecomputer.cpp | |
parent | f8e33e171a830c54a3df96939eed01efc2ca2c58 (diff) | |
download | subsurface-608209fff23417f77526bef836bb505bc05c7eff.tar.gz |
move process_dives to the mainthread
Avoids a race condition.
Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 52ef77d48..eaf8efd70 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -261,6 +261,10 @@ void DownloadFromDCWidget::onDownloadThreadFinished() updateState(DONE); else updateState(ERROR); + + // I'm not sure if we should really call process_dives even + // if there's an error or a cancelation + process_dives(TRUE, preferDownloaded()); } else updateState(CANCELLED); } @@ -320,7 +324,6 @@ static QString str_error(const char *fmt, ...) void DownloadThread::run() { - DownloadFromDCWidget *dfdcw = DownloadFromDCWidget::instance(); const char *error; if (!strcmp(data->vendor, "Uemis")) @@ -331,8 +334,4 @@ void DownloadThread::run() if (error) { this->error = str_error(error, data->devname, data->vendor, data->product); } - - // I'm not sure if we should really call process_dives even - // if there's an error or a cancelation - process_dives(TRUE, dfdcw->preferDownloaded()); } |