mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:43:24 +00:00
Do not add double ConnectionList items
Refuse to add a ConnectionList row, when the row is already there. This, obviously, prevents double items. Fixes: #1069 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
d5cb30efac
commit
2c8693f468
1 changed files with 5 additions and 3 deletions
|
@ -38,9 +38,11 @@ int ConnectionListModel::rowCount(const QModelIndex &parent) const
|
|||
|
||||
void ConnectionListModel::addAddress(const QString address)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
m_addresses.append(address);
|
||||
endInsertRows();
|
||||
if (!m_addresses.contains(address)) {
|
||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
m_addresses.append(address);
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionListModel::removeAllAddresses()
|
||||
|
|
Loading…
Add table
Reference in a new issue