Fix an assert in debug mode
This commit is contained in:
parent
41687767b9
commit
47847a5a57
1 changed files with 8 additions and 6 deletions
|
@ -652,13 +652,15 @@ void AircraftItemModel::onScanAddedItems(int addedCount)
|
|||
|
||||
void AircraftItemModel::onLocalCacheCleared()
|
||||
{
|
||||
const int firstRow = 0;
|
||||
const int lastRow = m_cachedLocalAircraftCount + 1;
|
||||
if (m_cachedLocalAircraftCount > 0) {
|
||||
const int firstRow = 0;
|
||||
const int lastRow = m_cachedLocalAircraftCount - 1;
|
||||
|
||||
beginRemoveRows(QModelIndex(), firstRow, lastRow);
|
||||
m_delegateStates.remove(0, m_cachedLocalAircraftCount);
|
||||
m_cachedLocalAircraftCount = 0;
|
||||
endRemoveRows();
|
||||
beginRemoveRows(QModelIndex(), firstRow, lastRow);
|
||||
m_delegateStates.remove(0, m_cachedLocalAircraftCount);
|
||||
m_cachedLocalAircraftCount = 0;
|
||||
endRemoveRows();
|
||||
}
|
||||
}
|
||||
|
||||
void AircraftItemModel::installFailed(QModelIndex index, simgear::pkg::Delegate::StatusCode reason)
|
||||
|
|
Loading…
Reference in a new issue