mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +08:00
refs #745, get temp. livery from web services
This commit is contained in:
@@ -370,6 +370,12 @@ namespace BlackCore
|
|||||||
return CLivery();
|
return CLivery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CLivery CWebDataServices::getTempLiveryOrDefault() const
|
||||||
|
{
|
||||||
|
if (m_modelDataReader) { return m_modelDataReader->getLiveryForCombinedCode(CLivery::tempLiveryCode()); }
|
||||||
|
return CLivery();
|
||||||
|
}
|
||||||
|
|
||||||
CLivery CWebDataServices::getStdLiveryForAirlineCode(const CAirlineIcaoCode &icao) const
|
CLivery CWebDataServices::getStdLiveryForAirlineCode(const CAirlineIcaoCode &icao) const
|
||||||
{
|
{
|
||||||
if (m_modelDataReader) { return m_modelDataReader->getStdLiveryForAirlineVDesignator(icao); }
|
if (m_modelDataReader) { return m_modelDataReader->getStdLiveryForAirlineVDesignator(icao); }
|
||||||
|
|||||||
@@ -181,6 +181,10 @@ namespace BlackCore
|
|||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
BlackMisc::Aviation::CLivery getLiveryForCombinedCode(const QString &combinedCode) const;
|
BlackMisc::Aviation::CLivery getLiveryForCombinedCode(const QString &combinedCode) const;
|
||||||
|
|
||||||
|
//! The temp. livery if available
|
||||||
|
//! \threadsafe
|
||||||
|
BlackMisc::Aviation::CLivery getTempLiveryOrDefault() const;
|
||||||
|
|
||||||
//! Standard livery for airline code
|
//! Standard livery for airline code
|
||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
BlackMisc::Aviation::CLivery getStdLiveryForAirlineCode(const BlackMisc::Aviation::CAirlineIcaoCode &icao) const;
|
BlackMisc::Aviation::CLivery getStdLiveryForAirlineCode(const BlackMisc::Aviation::CAirlineIcaoCode &icao) const;
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ namespace BlackGui
|
|||||||
void CLiveryForm::ps_setTemporaryLivery()
|
void CLiveryForm::ps_setTemporaryLivery()
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||||
const CLivery l = sGui->getWebDataServices()->getLiveryForCombinedCode(CLivery::tempLiveryCode());
|
const CLivery l = sGui->getWebDataServices()->getTempLiveryOrDefault();
|
||||||
if (l.isLoadedFromDb())
|
if (l.isLoadedFromDb())
|
||||||
{
|
{
|
||||||
this->setValue(l);
|
this->setValue(l);
|
||||||
|
|||||||
Reference in New Issue
Block a user