mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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,17 +1508,15 @@ void ReadSettingsThread::run()
|
||||||
supported = false;
|
supported = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
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 {
|
} else {
|
||||||
lastError = tr("Could not a establish connection to the dive computer.");
|
lastError = tr("Could not a establish connection to the dive computer.");
|
||||||
emit error(lastError);
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue