summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/connectionlistmodel.cpp7
-rw-r--r--core/connectionlistmodel.h1
2 files changed, 8 insertions, 0 deletions
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();
+}
diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h
index ec3a785fa..b7b1db5c9 100644
--- a/core/connectionlistmodel.h
+++ b/core/connectionlistmodel.h
@@ -15,6 +15,7 @@ public:
QString address(int idx) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
void addAddress(const QString address);
+ void removeAllAddresses();
private:
QStringList m_addresses;
};