From 8b8863b6407f4c80bfb3f4a51ea8eeeedf7f0ab5 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 11 Oct 2017 19:31:45 +0200 Subject: Add function to clear connectionModel data Preparation primarily for mobile. When we want to switch in one session from BT to cable connection and vise versa, we need a way to clear the model data containing the possible connections in use. Signed-off-by: Jan Mulder --- core/connectionlistmodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/connectionlistmodel.cpp') diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp index 3e1e0d71c..7f8b9894b 100644 --- a/core/connectionlistmodel.cpp +++ b/core/connectionlistmodel.cpp @@ -42,3 +42,10 @@ void ConnectionListModel::addAddress(const QString address) m_addresses.append(address); endInsertRows(); } + +void ConnectionListModel::removeAllAddresses() +{ + beginRemoveRows(QModelIndex(), 0, rowCount()); + m_addresses.clear(); + endRemoveRows(); +} -- cgit v1.2.3-70-g09d2