mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #815 Mark with \todo the remaining places where CJsonException needs to be caught.
This commit is contained in:
@@ -61,7 +61,7 @@ namespace BlackCore
|
|||||||
if (!airportsJson.isEmpty())
|
if (!airportsJson.isEmpty())
|
||||||
{
|
{
|
||||||
CAirportList airports;
|
CAirportList airports;
|
||||||
airports.convertFromJson(airportsJson);
|
airports.convertFromJson(airportsJson); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = airports.size();
|
const int c = airports.size();
|
||||||
this->m_airportCache.set(airports);
|
this->m_airportCache.set(airports);
|
||||||
|
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ namespace BlackCore
|
|||||||
if (!countriesJson.isEmpty())
|
if (!countriesJson.isEmpty())
|
||||||
{
|
{
|
||||||
CCountryList countries;
|
CCountryList countries;
|
||||||
countries.convertFromJson(Json::jsonObjectFromString(countriesJson));
|
countries.convertFromJson(Json::jsonObjectFromString(countriesJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = countries.size();
|
const int c = countries.size();
|
||||||
this->m_countryCache.set(countries);
|
this->m_countryCache.set(countries);
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ namespace BlackCore
|
|||||||
if (!aircraftJson.isEmpty())
|
if (!aircraftJson.isEmpty())
|
||||||
{
|
{
|
||||||
CAircraftIcaoCodeList aircraftIcaos;
|
CAircraftIcaoCodeList aircraftIcaos;
|
||||||
aircraftIcaos.convertFromJson(Json::jsonObjectFromString(aircraftJson));
|
aircraftIcaos.convertFromJson(Json::jsonObjectFromString(aircraftJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = aircraftIcaos.size();
|
const int c = aircraftIcaos.size();
|
||||||
this->m_aircraftIcaoCache.set(aircraftIcaos);
|
this->m_aircraftIcaoCache.set(aircraftIcaos);
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ namespace BlackCore
|
|||||||
if (!airlineJson.isEmpty())
|
if (!airlineJson.isEmpty())
|
||||||
{
|
{
|
||||||
CAirlineIcaoCodeList airlineIcaos;
|
CAirlineIcaoCodeList airlineIcaos;
|
||||||
airlineIcaos.convertFromJson(Json::jsonObjectFromString(airlineJson));
|
airlineIcaos.convertFromJson(Json::jsonObjectFromString(airlineJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = airlineIcaos.size();
|
const int c = airlineIcaos.size();
|
||||||
this->m_airlineIcaoCache.set(airlineIcaos);
|
this->m_airlineIcaoCache.set(airlineIcaos);
|
||||||
reallyRead |= CEntityFlags::AirlineIcaoEntity;
|
reallyRead |= CEntityFlags::AirlineIcaoEntity;
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ namespace BlackCore
|
|||||||
if (!liveriesJson.isEmpty())
|
if (!liveriesJson.isEmpty())
|
||||||
{
|
{
|
||||||
CLiveryList liveries;
|
CLiveryList liveries;
|
||||||
liveries.convertFromJson(liveriesJson);
|
liveries.convertFromJson(liveriesJson); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = liveries.size();
|
const int c = liveries.size();
|
||||||
this->m_liveryCache.set(liveries);
|
this->m_liveryCache.set(liveries);
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ namespace BlackCore
|
|||||||
if (!modelsJson.isEmpty())
|
if (!modelsJson.isEmpty())
|
||||||
{
|
{
|
||||||
CAircraftModelList models;
|
CAircraftModelList models;
|
||||||
models.convertFromJson(Json::jsonObjectFromString(modelsJson));
|
models.convertFromJson(Json::jsonObjectFromString(modelsJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = models.size();
|
const int c = models.size();
|
||||||
this->m_modelCache.set(models);
|
this->m_modelCache.set(models);
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ namespace BlackCore
|
|||||||
if (!distributorsJson.isEmpty())
|
if (!distributorsJson.isEmpty())
|
||||||
{
|
{
|
||||||
CDistributorList distributors;
|
CDistributorList distributors;
|
||||||
distributors.convertFromJson(Json::jsonObjectFromString(distributorsJson));
|
distributors.convertFromJson(Json::jsonObjectFromString(distributorsJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
const int c = distributors.size();
|
const int c = distributors.size();
|
||||||
this->m_distributorCache.set(distributors);
|
this->m_distributorCache.set(distributors);
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ namespace BlackCore
|
|||||||
QString content(CFileUtils::readFileToString(fn));
|
QString content(CFileUtils::readFileToString(fn));
|
||||||
if (content.isEmpty()) { return false; }
|
if (content.isEmpty()) { return false; }
|
||||||
CGlobalSetup s;
|
CGlobalSetup s;
|
||||||
s.convertFromJson(content);
|
s.convertFromJson(content); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
s.setDevelopment(true);
|
s.setDevelopment(true);
|
||||||
m_setup.set(s);
|
m_setup.set(s);
|
||||||
return true;
|
return true;
|
||||||
@@ -311,7 +311,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
const CGlobalSetup currentSetup = m_setup.get();
|
const CGlobalSetup currentSetup = m_setup.get();
|
||||||
CGlobalSetup loadedSetup;
|
CGlobalSetup loadedSetup;
|
||||||
loadedSetup.convertFromJson(Json::jsonObjectFromString(setupJson));
|
loadedSetup.convertFromJson(Json::jsonObjectFromString(setupJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
loadedSetup.markAsLoaded(true);
|
loadedSetup.markAsLoaded(true);
|
||||||
if (lastModified > 0 && lastModified > loadedSetup.getMSecsSinceEpoch()) { loadedSetup.setMSecsSinceEpoch(lastModified); }
|
if (lastModified > 0 && lastModified > loadedSetup.getMSecsSinceEpoch()) { loadedSetup.setMSecsSinceEpoch(lastModified); }
|
||||||
bool sameVersionLoaded = (loadedSetup == currentSetup);
|
bool sameVersionLoaded = (loadedSetup == currentSetup);
|
||||||
@@ -384,7 +384,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
CUpdateInfo currentUpdateInfo(m_updateInfo.get()); // from cache
|
CUpdateInfo currentUpdateInfo(m_updateInfo.get()); // from cache
|
||||||
CUpdateInfo loadedUpdateInfo;
|
CUpdateInfo loadedUpdateInfo;
|
||||||
loadedUpdateInfo.convertFromJson(Json::jsonObjectFromString(setupJson));
|
loadedUpdateInfo.convertFromJson(Json::jsonObjectFromString(setupJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
if (lastModified > 0 && lastModified > loadedUpdateInfo.getMSecsSinceEpoch()) { loadedUpdateInfo.setMSecsSinceEpoch(lastModified); }
|
if (lastModified > 0 && lastModified > loadedUpdateInfo.getMSecsSinceEpoch()) { loadedUpdateInfo.setMSecsSinceEpoch(lastModified); }
|
||||||
const bool sameVersionLoaded = (loadedUpdateInfo == currentUpdateInfo);
|
const bool sameVersionLoaded = (loadedUpdateInfo == currentUpdateInfo);
|
||||||
if (sameVersionLoaded)
|
if (sameVersionLoaded)
|
||||||
|
|||||||
@@ -1327,7 +1327,7 @@ namespace BlackGui
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ContainerType container;
|
ContainerType container;
|
||||||
container.convertFromJson(json);
|
container.convertFromJson(json); //! \todo catch CJsonException or use convertFromJsonNoThrow
|
||||||
m = this->modifyLoadedJsonData(container);
|
m = this->modifyLoadedJsonData(container);
|
||||||
if (m.isFailure()) { break; } // modification error
|
if (m.isFailure()) { break; } // modification error
|
||||||
m = this->validateLoadedJsonData(container);
|
m = this->validateLoadedJsonData(container);
|
||||||
|
|||||||
Reference in New Issue
Block a user