mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile/remember DCs: try to match device names
We only store the address part of the connection name, so don't try to find an exact match, try to find the sub-string. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f5411b7d68
commit
0ae57cfe92
4 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1760,6 +1760,11 @@ int QMLManager::getDetectedProductIndex(const QString ¤tVendorText)
|
|||
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
|
||||
|
|
|
@ -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 ¤tVendorText);
|
||||
Q_INVOKABLE int getConnectionIndex(const QString &deviceSubstr);
|
||||
|
||||
static QMLManager *instance();
|
||||
Q_INVOKABLE void registerError(QString error);
|
||||
|
|
Loading…
Add table
Reference in a new issue