summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/btdiscovery.cpp8
-rw-r--r--core/downloadfromdcthread.cpp9
2 files changed, 9 insertions, 8 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index b70330410..298c0408c 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -83,16 +83,16 @@ static dc_descriptor_t *getDeviceType(QString btName)
// number. The model code matches the hex model (so "FQ" is 0x4651,
// where 'F' is 46h and 'Q' is 51h in ASCII).
vendor = "Aqualung";
- product = "i200c";
+ product = "i200C";
} else if (btName.contains(QRegularExpression("^FH\\d{6}$"))) {
vendor = "Aqualung";
- product = "i300c";
+ product = "i300C";
} else if (btName.contains(QRegularExpression("^FQ\\d{6}$"))) {
vendor = "Aqualung";
product = "i770R";
} else if (btName.contains(QRegularExpression("^FR\\d{6}$"))) {
vendor = "Aqualung";
- product = "i550c";
+ product = "i550C";
} else if (btName.contains(QRegularExpression("^ER\\d{6}$"))) {
vendor = "Oceanic";
product = "Pro Plus X";
@@ -111,7 +111,7 @@ static dc_descriptor_t *getDeviceType(QString btName)
// check if we found a known dive computer
if (!vendor.isEmpty() && !product.isEmpty()) {
- dc_descriptor_t *lookup = descriptorLookup.value(vendor + product);
+ dc_descriptor_t *lookup = descriptorLookup.value(vendor.toLower() + product.toLower());
if (!lookup)
qWarning("known dive computer %s not found in descriptorLookup", qPrintable(QString(vendor + product)));
return lookup;
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index 8a3365842..d8a65c809 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -68,7 +68,7 @@ DownloadThread::DownloadThread() : downloadTable({ 0 }),
void DownloadThread::run()
{
auto internalData = m_data->internalData();
- internalData->descriptor = descriptorLookup[m_data->vendor() + m_data->product()];
+ internalData->descriptor = descriptorLookup[m_data->vendor().toLower() + m_data->product().toLower()];
internalData->download_table = &downloadTable;
internalData->sites = &diveSiteTable;
internalData->btname = strdup(m_data->devBluetoothName().toUtf8());
@@ -127,7 +127,7 @@ void fill_computer_list()
if (!productList[vendor].contains(product))
productList[vendor].append(product);
- descriptorLookup[QString(vendor) + QString(product)] = descriptor;
+ descriptorLookup[QString(vendor).toLower() + QString(product).toLower()] = descriptor;
}
dc_iterator_free(iterator);
Q_FOREACH (QString vendor, vendorList) {
@@ -157,7 +157,8 @@ void fill_computer_list()
if (!productList["Uemis"].contains("Zurich"))
productList["Uemis"].push_back("Zurich");
- descriptorLookup["UemisZurich"] = (dc_descriptor_t *)mydescriptor;
+ // note: keys in the descriptorLookup are always lowercase
+ descriptorLookup["uemiszurich"] = (dc_descriptor_t *)mydescriptor;
#endif
std::sort(vendorList.begin(), vendorList.end());
@@ -192,7 +193,7 @@ void show_computer_list()
Q_FOREACH (QString vendor, vendorList) {
QString msg = vendor + ": ";
Q_FOREACH (QString product, productList[vendor]) {
- dc_descriptor_t *descriptor = descriptorLookup[vendor + product];
+ dc_descriptor_t *descriptor = descriptorLookup[vendor.toLower() + product.toLower()];
unsigned int transport = dc_descriptor_get_transports(descriptor) & transportMask;
QString transportString = getTransportString(transport);
msg += product + " (" + transportString + "), ";