1
0
Fork 0

Launcher: improve local acft rescan behaviour

This commit is contained in:
James Turner 2021-09-28 14:33:25 +01:00
parent 4d238b18e3
commit 8574b4f1bc
2 changed files with 9 additions and 5 deletions

View file

@ -485,6 +485,10 @@ private:
QStringList filters;
filters << "*-set.xml";
Q_FOREACH(QFileInfo child, path.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
if (m_done) { // thread termination bail-out
return;
}
QDir childDir(child.absoluteFilePath());
QMap<QString, AircraftItemPtr> baseAircraft;
QList<AircraftItemPtr> variants;
@ -729,7 +733,7 @@ void LocalAircraftCache::abandonCurrentScan()
&LocalAircraftCache::onScanFinished);
d->m_scanThread->setDone();
if (!d->m_scanThread->wait(2000)) {
if (!d->m_scanThread->wait(32000)) {
qWarning() << Q_FUNC_INFO << "scan thread failed to terminate";
}
d->m_scanThread.reset();

View file

@ -698,10 +698,6 @@ bool runLauncherDialog()
}
int appResult = qApp->exec();
if (appResult <= 0) {
return false; // quit
}
// avoid crashes / NavCache races if the loader is still running after
// the launcher exits
if (naturalEarthLoader) {
@ -716,6 +712,10 @@ bool runLauncherDialog()
globals->clear_fg_scenery();
globals->get_locale()->clear();
if (appResult <= 0) {
return false; // quit
}
return true;
}