1
0
Fork 0

Fix an assert on Windows

This commit is contained in:
James Turner 2016-06-29 16:25:42 +01:00
parent 0b11dd626a
commit 40b74c4e32

View file

@ -503,16 +503,18 @@ QModelIndex AircraftItemModel::officialHangarMessageIndex() const
void AircraftItemModel::scanDirs()
{
abandonCurrentScan();
abandonCurrentScan();
int firstRow = (m_showOfficialHangarMessage ? 1 : 0);
int numToRemove = m_items.size() - firstRow;
int lastRow = firstRow + numToRemove - 1;
int firstRow = (m_showOfficialHangarMessage ? 1 : 0);
int numToRemove = m_items.size() - firstRow;
if (numToRemove > 0) {
int lastRow = firstRow + numToRemove - 1;
beginRemoveRows(QModelIndex(), firstRow, lastRow);
m_items.remove(firstRow, numToRemove);
m_activeVariant.remove(firstRow, numToRemove);
endRemoveRows();
beginRemoveRows(QModelIndex(), firstRow, lastRow);
m_items.remove(firstRow, numToRemove);
m_activeVariant.remove(firstRow, numToRemove);
endRemoveRows();
}
QStringList dirs = m_paths;