mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Restructure ReadSettingsThread::run
This moves the dc_device_close call inside the if case for dc_device_open, to get rid of the special error case and to look and behave the same as the other ::run calls. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a8c013869b
commit
d850a67ce8
1 changed files with 6 additions and 8 deletions
|
@ -1508,18 +1508,16 @@ void ReadSettingsThread::run()
|
|||
supported = false;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
lastError = tr("Could not a establish connection to the dive computer.");
|
||||
emit error(lastError);
|
||||
// So we don't trigger the "unsupported" clause later..
|
||||
supported = true;
|
||||
}
|
||||
dc_device_close(m_data->device);
|
||||
|
||||
if (!supported) {
|
||||
lastError = tr("This feature is not yet available for the selected dive computer.");
|
||||
emit error(lastError);
|
||||
}
|
||||
} else {
|
||||
lastError = tr("Could not a establish connection to the dive computer.");
|
||||
emit error(lastError);
|
||||
}
|
||||
}
|
||||
|
||||
WriteSettingsThread::WriteSettingsThread(QObject *parent, device_data_t *data) : DeviceThread(parent, data)
|
||||
|
|
Loading…
Reference in a new issue