fixed crew adding overhead

This commit is contained in:
Rafael 2016-03-27 11:07:22 +02:00
parent e3b46832ec
commit dca79a061c

View file

@ -36,6 +36,8 @@ void ProfileLoader::run()
QDir profileDir; QDir profileDir;
profileDir.setPath(profileFolder); profileDir.setPath(profileFolder);
QList<int> crewList;
profileDir.setNameFilters(QStringList("SGTA*")); profileDir.setNameFilters(QStringList("SGTA*"));
QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort); QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
QStringList BackupFiles = SavegameFiles.filter(".bak", Qt::CaseInsensitive); QStringList BackupFiles = SavegameFiles.filter(".bak", Qt::CaseInsensitive);
@ -69,9 +71,19 @@ void ProfileLoader::run()
if (picture->readingPicture()) if (picture->readingPicture())
{ {
emit pictureLoaded(picture, picturePath); emit pictureLoaded(picture, picturePath);
crewDB->addCrew(picture->getCrewNumber()); int crewNumber = picture->getCrewNumber();
if (!crewList.contains(crewNumber))
{
crewList.append(crewNumber);
}
} }
loadedV++; loadedV++;
emit loadingProgress(loadedV, maximumV); emit loadingProgress(loadedV, maximumV);
} }
// adding found crews
foreach(int crewID, crewList)
{
crewDB->addCrew(crewID);
}
} }