mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Ref T529, model loader improvements
* XP loader improved progress messages * added LoadingFailed * use "Qt::QueuedConnection" for CMultiAircraftModelLoaderProvider In some cases the loading progress signal was not send properly changing to Qt::QueuedConnection has solved the issue
This commit is contained in:
committed by
Mat Sutcliffe
parent
91050e198c
commit
02f638501e
@@ -117,6 +117,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (m_parserWorker && !m_parserWorker->isFinished()) { return; }
|
||||
emit this->diskLoadingStarted(simulator, mode);
|
||||
|
||||
m_parserWorker = CWorker::fromTask(this, "CAircraftModelLoaderXPlane::performParsing",
|
||||
[this, modelDirs, excludedDirectoryPatterns, modelConsolidation]()
|
||||
{
|
||||
@@ -147,7 +148,8 @@ namespace BlackMisc
|
||||
void CAircraftModelLoaderXPlane::updateInstalledModels(const CAircraftModelList &models)
|
||||
{
|
||||
this->setModelsForSimulator(models, CSimulatorInfo::xplane());
|
||||
emit this->loadingFinished(CStatusMessage(this, CStatusMessage::SeverityInfo, u"XPlane updated '%1' models") << models.size(), CSimulatorInfo::xplane(), ParsedData);
|
||||
const CStatusMessage m = CStatusMessage(this, CStatusMessage::SeverityInfo, u"XPlane updated '%1' models") << models.size();
|
||||
m_loadingMessages.push_back(m);
|
||||
}
|
||||
|
||||
QString CAircraftModelLoaderXPlane::CSLPlane::getModelName() const
|
||||
@@ -216,6 +218,7 @@ namespace BlackMisc
|
||||
|
||||
const QString baseModelString = model.getModelString();
|
||||
QDirIterator liveryIt(aircraftIt.fileInfo().canonicalPath() + "/liveries", QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
emit loadingProgress(this->getSimulator(), QStringLiteral("Parsing flyable liveries in '%1'").arg(aircraftIt.fileInfo().canonicalPath()), -1);
|
||||
while (liveryIt.hasNext())
|
||||
{
|
||||
liveryIt.next();
|
||||
@@ -258,10 +261,8 @@ namespace BlackMisc
|
||||
// Now we do a full run
|
||||
for (auto &package : m_cslPackages)
|
||||
{
|
||||
QString packageFile(package.path);
|
||||
packageFile += "/xsb_aircraft.txt";
|
||||
|
||||
emit loadingProgress(this->getSimulator(), QStringLiteral("Parsing '%1'").arg(packageFile), -1);
|
||||
const QString packageFile = CFileUtils::appendFilePaths(package.path, "/xsb_aircraft.txt");
|
||||
emit this->loadingProgress(this->getSimulator(), QStringLiteral("Parsing CSL '%1'").arg(packageFile), -1);
|
||||
|
||||
QFile file(packageFile);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
|
||||
Reference in New Issue
Block a user