diff --git a/src/blackcore/webdataservices.cpp b/src/blackcore/webdataservices.cpp index 529121189..9d3058fda 100644 --- a/src/blackcore/webdataservices.cpp +++ b/src/blackcore/webdataservices.cpp @@ -370,6 +370,12 @@ namespace BlackCore return CLivery(); } + CLivery CWebDataServices::getTempLiveryOrDefault() const + { + if (m_modelDataReader) { return m_modelDataReader->getLiveryForCombinedCode(CLivery::tempLiveryCode()); } + return CLivery(); + } + CLivery CWebDataServices::getStdLiveryForAirlineCode(const CAirlineIcaoCode &icao) const { if (m_modelDataReader) { return m_modelDataReader->getStdLiveryForAirlineVDesignator(icao); } diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index e831c0eef..99c00f835 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -181,6 +181,10 @@ namespace BlackCore //! \threadsafe BlackMisc::Aviation::CLivery getLiveryForCombinedCode(const QString &combinedCode) const; + //! The temp. livery if available + //! \threadsafe + BlackMisc::Aviation::CLivery getTempLiveryOrDefault() const; + //! Standard livery for airline code //! \threadsafe BlackMisc::Aviation::CLivery getStdLiveryForAirlineCode(const BlackMisc::Aviation::CAirlineIcaoCode &icao) const; diff --git a/src/blackgui/editors/liveryform.cpp b/src/blackgui/editors/liveryform.cpp index e6041cb6a..67cbb11f4 100644 --- a/src/blackgui/editors/liveryform.cpp +++ b/src/blackgui/editors/liveryform.cpp @@ -199,7 +199,7 @@ namespace BlackGui void CLiveryForm::ps_setTemporaryLivery() { if (!sGui || !sGui->hasWebDataServices()) { return; } - const CLivery l = sGui->getWebDataServices()->getLiveryForCombinedCode(CLivery::tempLiveryCode()); + const CLivery l = sGui->getWebDataServices()->getTempLiveryOrDefault(); if (l.isLoadedFromDb()) { this->setValue(l);