mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <jlmulder@xs4all.nl>
This commit is contained in:
parent
f7d120e39c
commit
8b8863b640
2 changed files with 8 additions and 0 deletions
|
|
@ -42,3 +42,10 @@ void ConnectionListModel::addAddress(const QString address)
|
||||||
m_addresses.append(address);
|
m_addresses.append(address);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectionListModel::removeAllAddresses()
|
||||||
|
{
|
||||||
|
beginRemoveRows(QModelIndex(), 0, rowCount());
|
||||||
|
m_addresses.clear();
|
||||||
|
endRemoveRows();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ public:
|
||||||
QString address(int idx) const;
|
QString address(int idx) const;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
void addAddress(const QString address);
|
void addAddress(const QString address);
|
||||||
|
void removeAllAddresses();
|
||||||
private:
|
private:
|
||||||
QStringList m_addresses;
|
QStringList m_addresses;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue