aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-08 11:56:00 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 07:47:22 -0800
commit6b11f94996da1aa8b9291e2e7b491c24d9713604 (patch)
treee0b173e0dd4a725b2e6f7b349d7e80324da91f35
parentafafbb3a3e1032e57566d9649871b9ef5037ea29 (diff)
downloadsubsurface-6b11f94996da1aa8b9291e2e7b491c24d9713604.tar.gz
Dive d/l selection UI: Only try to get the dive list if d/l succeeded
This fixes a crash where we tried to get the data without actually having downloaded anything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 08ba9408d..3181faba8 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -405,6 +405,9 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
void DownloadFromDCWidget::on_ok_clicked()
{
+ if (currentState != DONE)
+ return;
+
// remove all unselected dives from the dive-list.
diveImportedModel->removeUnused();