mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Issue #77 Break cyclic dependency statusmessage <-> jsonexception
This commit is contained in:
@@ -116,7 +116,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit dataRead(CEntityFlags::AirportEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
return ex.toStatusMessage(this, QStringLiteral("Reading airports from '%1'").arg(fileName));
|
||||
return CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading airports from '%1'").arg(fileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::CountryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading countries from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading countries from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -583,7 +583,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading aircraft ICAOs from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading aircraft ICAOs from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -622,7 +622,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AirlineIcaoEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading airline ICAOs from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading airline ICAOs from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -661,7 +661,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::AircraftCategoryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading categories from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading categories from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::LiveryEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading liveries from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading liveries from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -533,7 +533,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::ModelEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading models from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading models from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,7 @@ namespace BlackCore
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
emit this->dataRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFailed, 0, url);
|
||||
msgs.push_back(ex.toStatusMessage(this, QStringLiteral("Reading distributors from '%1'").arg(fileName)));
|
||||
msgs.push_back(CStatusMessage::fromJsonException(ex, this, QStringLiteral("Reading distributors from '%1'").arg(fileName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace BlackCore
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
return ex.toStatusMessage(this, QStringLiteral("Parsing local setup file '%1'").arg(fn));
|
||||
return CStatusMessage::fromJsonException(ex, this, QStringLiteral("Parsing local setup file '%1'").arg(fn));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ namespace BlackCore
|
||||
// we downloaded an unparsable JSON file.
|
||||
// as we control those files something is wrong
|
||||
const QString errorMsg = QStringLiteral("Setup file loaded from '%1' cannot be parsed").arg(urlString);
|
||||
const CStatusMessage msg = ex.toStatusMessage(this, errorMsg);
|
||||
const CStatusMessage msg = CStatusMessage::fromJsonException(ex, this, errorMsg);
|
||||
CLogMessage::preformatted(msg);
|
||||
emit this->setupLoadingMessages(msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user