mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:53: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)
|
void ConnectionListModel::addAddress(const QString address)
|
||||||
{
|
{
|
||||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
if (!m_addresses.contains(address)) {
|
||||||
m_addresses.append(address);
|
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||||
endInsertRows();
|
m_addresses.append(address);
|
||||||
|
endInsertRows();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionListModel::removeAllAddresses()
|
void ConnectionListModel::removeAllAddresses()
|
||||||
|
|
Loading…
Add table
Reference in a new issue