summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/connectionlistmodel.cpp3
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml2
-rw-r--r--mobile-widgets/qmlmanager.cpp5
-rw-r--r--mobile-widgets/qmlmanager.h1
4 files changed, 9 insertions, 2 deletions
diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp
index aaa829949..b4c0f0ea8 100644
--- a/core/connectionlistmodel.cpp
+++ b/core/connectionlistmodel.cpp
@@ -53,5 +53,6 @@ void ConnectionListModel::removeAllAddresses()
int ConnectionListModel::indexOf(QString address)
{
- return m_addresses.indexOf(address);
+ const QRegExp re(address, Qt::CaseInsensitive);
+ return m_addresses.indexOf(re);
}
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index f90086ac9..a2545db13 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -183,7 +183,7 @@ Kirigami.Page {
function setDC(vendor, product, device) {
comboVendor.currentIndex = comboVendor.find(vendor);
comboProduct.currentIndex = comboProduct.find(product);
- comboConnection.currentIndex = comboConnection.find(device);
+ comboConnection.currentIndex = manager.getConnectionIndex(device);
}
SsrfButton {
id: dc1
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index d6c00c870..aa9cf3d75 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1760,6 +1760,11 @@ int QMLManager::getDetectedProductIndex(const QString &currentVendorText)
return m_device_data->getDetectedProductIndex(currentVendorText);
}
+int QMLManager::getConnectionIndex(const QString &deviceSubstr)
+{
+ return connectionListModel.indexOf(deviceSubstr);
+}
+
void QMLManager::showDownloadPage(QString deviceString)
{
// we pass the indices for the three combo boxes for vendor, product, and connection
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index b8f44d820..674db311c 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -87,6 +87,7 @@ public:
Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product);
Q_INVOKABLE int getDetectedVendorIndex();
Q_INVOKABLE int getDetectedProductIndex(const QString &currentVendorText);
+ Q_INVOKABLE int getConnectionIndex(const QString &deviceSubstr);
static QMLManager *instance();
Q_INVOKABLE void registerError(QString error);