diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-04-25 15:51:35 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-04-27 11:52:48 -0700 |
commit | 028299193ad24cc6bfa52fa15e2e16a398c5bed2 (patch) | |
tree | 0545271e503cef4487eaf24bddb653d786636327 /core/downloadfromdcthread.cpp | |
parent | 5faa167e9fdab0e0c9b1a24346440c3006659c66 (diff) | |
download | subsurface-028299193ad24cc6bfa52fa15e2e16a398c5bed2.tar.gz |
Create one function to determine the supported transports
This should make sure we create a consistent view based on all the
information available.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index da2140b11..1c60ca6cf 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -107,28 +107,14 @@ void fill_computer_list() dc_iterator_t *iterator = NULL; dc_descriptor_t *descriptor = NULL; - // start out with the list of transports that libdivecomputer claims to support - // dc_context_get_transports ignores its context argument... - int transportMask = dc_context_get_transports(NULL); - - // then add the ones that we have our own implementations for -#if defined(BT_SUPPORT) - transportMask |= DC_TRANSPORT_BLUETOOTH; -#endif -#if defined(BLE_SUPPORT) - transportMask |= DC_TRANSPORT_BLE; -#endif -#if defined(Q_OS_IOS) - // libdivecomputer always claims to support serial, but on iOS we actually don't support that - transportMask &= ~DC_TRANSPORT_SERIAL; -#endif + unsigned int transportMask = get_supported_transports(NULL); fill_supported_mobile_list(); dc_descriptor_iterator(&iterator); while (dc_iterator_next(iterator, &descriptor) == DC_STATUS_SUCCESS) { // mask out the transports that aren't supported - int transports = dc_descriptor_get_transports(descriptor) & transportMask; + unsigned int transports = dc_descriptor_get_transports(descriptor) & transportMask; if (transports == 0) // none of the transports are available, skip continue; |