summaryrefslogtreecommitdiffstats
path: root/configuredivecomputerthreads.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-10-21 23:21:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-21 14:42:29 -0700
commit7afc65b99b63f9f614cb79d0fa528dcd75ec80e2 (patch)
tree40d62c7ae233956e343a3a34e2caf5cc0dc69fcf /configuredivecomputerthreads.cpp
parenteebb335a0c0da207e15267c2ae3d1140eb0b1b82 (diff)
downloadsubsurface-7afc65b99b63f9f614cb79d0fa528dcd75ec80e2.tar.gz
Check return value after firmware updates
This reports back a error to the user if the firmware update failed. We should re-wire this to have a log-function that gets called from libdivecomputer via the context to get an actual error message. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r--configuredivecomputerthreads.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 5f92a63f1..6d12d4d88 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -695,11 +695,11 @@ void FirmwareUpdateThread::run()
case DC_FAMILY_HW_OSTC3:
//Not Yet supported
//supported = true;
- //hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
+ //rc = hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
break;
case DC_FAMILY_HW_OSTC:
supported = true;
- hw_ostc_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
+ rc = hw_ostc_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
break;
#endif // divecomputer 0.5.0
default:
@@ -711,6 +711,8 @@ void FirmwareUpdateThread::run()
if (!supported) {
lastError = tr("This feature is not yet available for the selected dive computer.");
emit error(lastError);
+ } else if (rc != DC_STATUS_SUCCESS) {
+ lastError = tr("Firmware update failed!");
}
}
else {