core: add indexOf member to ConnectionListModel

This will allow us to programatically set the connection in the QML UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-08-08 05:54:10 -07:00
parent 842210c80d
commit 1bbbc07dd5
2 changed files with 6 additions and 0 deletions

View file

@ -50,3 +50,8 @@ void ConnectionListModel::removeAllAddresses()
m_addresses.clear();
endRemoveRows();
}
int ConnectionListModel::indexOf(QString address)
{
return m_addresses.indexOf(address);
}

View file

@ -16,6 +16,7 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
void addAddress(const QString address);
void removeAllAddresses();
int indexOf(QString address);
private:
QStringList m_addresses;
};