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()
|
void AircraftItemModel::onLocalCacheCleared()
|
||||||
{
|
{
|
||||||
const int firstRow = 0;
|
if (m_cachedLocalAircraftCount > 0) {
|
||||||
const int lastRow = m_cachedLocalAircraftCount + 1;
|
const int firstRow = 0;
|
||||||
|
const int lastRow = m_cachedLocalAircraftCount - 1;
|
||||||
|
|
||||||
beginRemoveRows(QModelIndex(), firstRow, lastRow);
|
beginRemoveRows(QModelIndex(), firstRow, lastRow);
|
||||||
m_delegateStates.remove(0, m_cachedLocalAircraftCount);
|
m_delegateStates.remove(0, m_cachedLocalAircraftCount);
|
||||||
m_cachedLocalAircraftCount = 0;
|
m_cachedLocalAircraftCount = 0;
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AircraftItemModel::installFailed(QModelIndex index, simgear::pkg::Delegate::StatusCode reason)
|
void AircraftItemModel::installFailed(QModelIndex index, simgear::pkg::Delegate::StatusCode reason)
|
||||||
|
|
Loading…
Add table
Reference in a new issue