diff options
-rw-r--r-- | core/connectionlistmodel.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp index e4ac8bfeb..d97d4722c 100644 --- a/core/connectionlistmodel.cpp +++ b/core/connectionlistmodel.cpp @@ -39,9 +39,12 @@ void ConnectionListModel::addAddress(const QString &address) void ConnectionListModel::removeAllAddresses() { - beginRemoveRows(QModelIndex(), 0, rowCount()); + if (rowCount() == 0) + return; + + beginResetModel(); m_addresses.clear(); - endRemoveRows(); + endResetModel(); } int ConnectionListModel::indexOf(const QString &address) const |