kopia lustrzana https://github.com/f4exb/sdrangel
Fix assertion when removing all elements from model
rodzic
6ad057e935
commit
53cccf7298
|
@ -378,7 +378,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeAllAirports() {
|
void removeAllAirports() {
|
||||||
beginRemoveRows(QModelIndex(), 0, m_airports.count());
|
if (m_airports.count() > 0)
|
||||||
|
{
|
||||||
|
beginRemoveRows(QModelIndex(), 0, m_airports.count() - 1);
|
||||||
m_airports.clear();
|
m_airports.clear();
|
||||||
m_airportDataFreq.clear();
|
m_airportDataFreq.clear();
|
||||||
m_airportDataFreqRows.clear();
|
m_airportDataFreqRows.clear();
|
||||||
|
@ -387,6 +389,7 @@ public:
|
||||||
m_elevation.clear();
|
m_elevation.clear();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override {
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override {
|
||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
|
|
|
@ -143,13 +143,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeAllVORs() {
|
void removeAllVORs() {
|
||||||
beginRemoveRows(QModelIndex(), 0, m_vors.count());
|
if (m_vors.count() > 0)
|
||||||
|
{
|
||||||
|
beginRemoveRows(QModelIndex(), 0, m_vors.count() - 1);
|
||||||
m_vors.clear();
|
m_vors.clear();
|
||||||
m_selected.clear();
|
m_selected.clear();
|
||||||
m_radials.clear();
|
m_radials.clear();
|
||||||
m_vorGUIs.clear();
|
m_vorGUIs.clear();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray> roleNames() const {
|
QHash<int, QByteArray> roleNames() const {
|
||||||
QHash<int, QByteArray> roles;
|
QHash<int, QByteArray> roles;
|
||||||
|
|
|
@ -350,12 +350,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeAll()
|
void removeAll()
|
||||||
|
{
|
||||||
|
if (m_items.count() > 0)
|
||||||
{
|
{
|
||||||
beginRemoveRows(QModelIndex(), 0, m_items.count());
|
beginRemoveRows(QModelIndex(), 0, m_items.count());
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
m_selected.clear();
|
m_selected.clear();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void setDisplayNames(bool displayNames)
|
void setDisplayNames(bool displayNames)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,13 +144,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeAllVORs() {
|
void removeAllVORs() {
|
||||||
beginRemoveRows(QModelIndex(), 0, m_vors.count());
|
if (m_vors.count() > 0)
|
||||||
|
{
|
||||||
|
beginRemoveRows(QModelIndex(), 0, m_vors.count() - 1);
|
||||||
m_vors.clear();
|
m_vors.clear();
|
||||||
m_selected.clear();
|
m_selected.clear();
|
||||||
m_radials.clear();
|
m_radials.clear();
|
||||||
m_vorGUIs.clear();
|
m_vorGUIs.clear();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray> roleNames() const {
|
QHash<int, QByteArray> roleNames() const {
|
||||||
QHash<int, QByteArray> roles;
|
QHash<int, QByteArray> roles;
|
||||||
|
|
Ładowanie…
Reference in New Issue