From 1bbbc07dd5a969554c6d4041593d7b7e3ad25e5f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 8 Aug 2018 05:54:10 -0700 Subject: core: add indexOf member to ConnectionListModel This will allow us to programatically set the connection in the QML UI. Signed-off-by: Dirk Hohndel --- core/connectionlistmodel.cpp | 5 +++++ core/connectionlistmodel.h | 1 + 2 files changed, 6 insertions(+) (limited to 'core') diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp index 04d1d5909..aaa829949 100644 --- a/core/connectionlistmodel.cpp +++ b/core/connectionlistmodel.cpp @@ -50,3 +50,8 @@ void ConnectionListModel::removeAllAddresses() m_addresses.clear(); endRemoveRows(); } + +int ConnectionListModel::indexOf(QString address) +{ + return m_addresses.indexOf(address); +} diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h index b7b1db5c9..11a93bfbc 100644 --- a/core/connectionlistmodel.h +++ b/core/connectionlistmodel.h @@ -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; }; -- cgit v1.2.3-70-g09d2