diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index 298b9a76f..89a0b6c82 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -19,7 +19,6 @@ #include "blackmisc/aviation/heading.h" #include "blackmisc/geo/latitude.h" #include "blackmisc/geo/longitude.h" -#include "blackmisc/iconlist.h" #include "blackmisc/pq/angle.h" #include "blackmisc/pq/frequency.h" #include "blackmisc/pq/speed.h" @@ -65,7 +64,7 @@ namespace BlackGui void CSimulatorComponent::addOrUpdateLiveDataByName(const QString &name, const QString &value, CIcons::IconIndex iconIndex) { - this->addOrUpdateLiveDataByName(name, value, CIconList::iconByIndex(iconIndex)); + this->addOrUpdateLiveDataByName(name, value, CIcon::iconByIndex(iconIndex)); } int CSimulatorComponent::rowCount() const @@ -112,8 +111,8 @@ namespace BlackGui const CComSystem c2 = ownAircraft.getCom2System(); static const CIcon iconAlt(s.getAltitude().toIcon()); // minor performance improvement static const CIcon iconLatLng(s.latitude().toIcon()); - static const CIcon iconRadio(CIconList::iconByIndex(CIcons::StandardIconRadio16)); - static const CIcon iconAttitude(CIconList::iconByIndex(CIcons::AviationAttitudeIndicator)); + static const CIcon iconRadio(CIcon::iconByIndex(CIcons::StandardIconRadio16)); + static const CIcon iconAttitude(CIcon::iconByIndex(CIcons::AviationAttitudeIndicator)); this->addOrUpdateLiveDataByName("latitude", s.latitude().toFormattedQString(), iconLatLng); this->addOrUpdateLiveDataByName("longitude", s.longitude().toFormattedQString(), iconLatLng); diff --git a/src/blackgui/models/columnformatters.cpp b/src/blackgui/models/columnformatters.cpp index 2fa611c2d..de80febec 100644 --- a/src/blackgui/models/columnformatters.cpp +++ b/src/blackgui/models/columnformatters.cpp @@ -344,7 +344,7 @@ namespace BlackGui { } CBoolIconFormatter::CBoolIconFormatter(CIcons::IconIndex onIcon, CIcons::IconIndex offIcon, const QString &onName, const QString &offName, int alignment) : - CBoolIconFormatter(CIconList::iconByIndex(onIcon), CIconList::iconByIndex(offIcon), onName, offName, alignment) + CBoolIconFormatter(CIcon::iconByIndex(onIcon), CIcon::iconByIndex(offIcon), onName, offName, alignment) { } CBoolIconFormatter::CBoolIconFormatter(const CIcon &onIcon, const CIcon &offIcon, const QString &onName, const QString &offName, int alignment) : diff --git a/src/blackgui/textmessagetextedit.cpp b/src/blackgui/textmessagetextedit.cpp index 9cb96b1b6..bd644837d 100644 --- a/src/blackgui/textmessagetextedit.cpp +++ b/src/blackgui/textmessagetextedit.cpp @@ -11,9 +11,6 @@ #include "blackgui/stylesheetutility.h" #include "blackgui/textmessagetextedit.h" #include "blackmisc/aviation/callsign.h" -#include "blackmisc/icon.h" -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include "blackmisc/network/textmessage.h" #include @@ -38,7 +35,7 @@ namespace BlackGui // menu this->setContextMenuPolicy(Qt::CustomContextMenu); - m_actionClearTextEdit = new QAction(CIconList::iconByIndex(CIcons::StandardIconDelete16).toQIcon(), "Clear", this); + m_actionClearTextEdit = new QAction(CIcon::iconByIndex(CIcons::StandardIconDelete16).toQIcon(), "Clear", this); m_actionLast10 = new QAction("Keep last 10 messages", this); m_actionLast25 = new QAction("Keep last 25 messages", this); m_actionAll = new QAction("Keep all messages", this); diff --git a/src/blackmisc/aviation/altitude.cpp b/src/blackmisc/aviation/altitude.cpp index e5408631c..f564d9eaa 100644 --- a/src/blackmisc/aviation/altitude.cpp +++ b/src/blackmisc/aviation/altitude.cpp @@ -103,7 +103,7 @@ namespace BlackMisc CIcon CAltitude::toIcon() const { - return BlackMisc::CIconList::iconByIndex(CIcons::GeoPosition); + return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition); } } // namespace diff --git a/src/blackmisc/aviation/callsign.cpp b/src/blackmisc/aviation/callsign.cpp index 24c10379a..d0760d744 100644 --- a/src/blackmisc/aviation/callsign.cpp +++ b/src/blackmisc/aviation/callsign.cpp @@ -9,8 +9,6 @@ #include "blackmisc/aviation/callsign.h" #include "blackmisc/compare.h" -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include #include @@ -39,7 +37,7 @@ namespace BlackMisc { if (callsign.getTypeHint() == CCallsign::Aircraft || !callsign.hasSuffix()) { - return CIconList::iconByIndex(CIcons::NetworkRolePilot); + return CIcon::iconByIndex(CIcons::NetworkRolePilot); } else { @@ -49,21 +47,21 @@ namespace BlackMisc const CIcon &CCallsign::atcSuffixToIcon(const QString &suffix) { - if (suffix.length() < 3) { return CIconList::iconByIndex(CIcons::NetworkRoleUnknown); } + if (suffix.length() < 3) { return CIcon::iconByIndex(CIcons::NetworkRoleUnknown); } QString sfx = suffix.toUpper(); - if ("APP" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleApproach); } - if ("GND" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleGround); } - if ("TWR" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleTower); } - if ("DEL" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleDelivery); } - if ("CTR" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleCenter); } - if ("SUP" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleSup); } - if ("OBS" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleObs); } - if ("INS" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleMnt); } - if ("FSS" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleFss); } - if ("ATIS" == sfx) { return CIconList::iconByIndex(CIcons::AviationAtis); } - if ("EXAM" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleMnt); } - if ("VATSIM" == sfx) { return CIconList::iconByIndex(CIcons::NetworkVatsimLogoWhite); } - return CIconList::iconByIndex(CIcons::NetworkRoleUnknown); + if ("APP" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleApproach); } + if ("GND" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleGround); } + if ("TWR" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleTower); } + if ("DEL" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleDelivery); } + if ("CTR" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleCenter); } + if ("SUP" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleSup); } + if ("OBS" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleObs); } + if ("INS" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleMnt); } + if ("FSS" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleFss); } + if ("ATIS" == sfx) { return CIcon::iconByIndex(CIcons::AviationAtis); } + if ("EXAM" == sfx) { return CIcon::iconByIndex(CIcons::NetworkRoleMnt); } + if ("VATSIM" == sfx) { return CIcon::iconByIndex(CIcons::NetworkVatsimLogoWhite); } + return CIcon::iconByIndex(CIcons::NetworkRoleUnknown); } bool CCallsign::isAtcCallsign() const diff --git a/src/blackmisc/aviation/flightplan.cpp b/src/blackmisc/aviation/flightplan.cpp index 967a394ba..f5fb0e94a 100644 --- a/src/blackmisc/aviation/flightplan.cpp +++ b/src/blackmisc/aviation/flightplan.cpp @@ -42,7 +42,7 @@ namespace BlackMisc BlackMisc::CIcon CFlightPlan::toIcon() const { - return BlackMisc::CIconList::iconByIndex(CIcons::StandardIconAppFlightPlan16); + return BlackMisc::CIcon::iconByIndex(CIcons::StandardIconAppFlightPlan16); } } // namespace } // namespace diff --git a/src/blackmisc/db/datastore.cpp b/src/blackmisc/db/datastore.cpp index 927908925..320cf1f08 100644 --- a/src/blackmisc/db/datastore.cpp +++ b/src/blackmisc/db/datastore.cpp @@ -11,8 +11,6 @@ #include "blackmisc/comparefunctions.h" #include "blackmisc/db/datastoreutility.h" #include "blackmisc/icon.h" -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include #include @@ -56,7 +54,7 @@ namespace BlackMisc const CIcon &IDatastoreObjectWithIntegerKey::toDatabaseIcon() const { static const CIcon empty; - if (this->hasValidDbKey()) { return CIconList::iconByIndex(CIcons::StandardIconDatabaseKey16); } + if (this->hasValidDbKey()) { return CIcon::iconByIndex(CIcons::StandardIconDatabaseKey16); } return empty; } @@ -153,7 +151,7 @@ namespace BlackMisc const CIcon &IDatastoreObjectWithStringKey::toDatabaseIcon() const { static const CIcon empty; - if (this->hasValidDbKey()) { return CIconList::iconByIndex(CIcons::StandardIconDatabaseKey16); } + if (this->hasValidDbKey()) { return CIcon::iconByIndex(CIcons::StandardIconDatabaseKey16); } return empty; } diff --git a/src/blackmisc/geo/earthangle.cpp b/src/blackmisc/geo/earthangle.cpp index 5c49e6f02..b04cdab1f 100644 --- a/src/blackmisc/geo/earthangle.cpp +++ b/src/blackmisc/geo/earthangle.cpp @@ -8,8 +8,6 @@ */ #include "blackmisc/geo/earthangle.h" -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include "blackmisc/pq/units.h" #include "blackmisc/geo/latitude.h" #include "blackmisc/geo/longitude.h" @@ -148,7 +146,7 @@ namespace BlackMisc template CIcon CEarthAngle::toIcon() const { - return BlackMisc::CIconList::iconByIndex(CIcons::GeoPosition); + return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition); } // see here for the reason of thess forward instantiations diff --git a/src/blackmisc/iconlist.cpp b/src/blackmisc/iconlist.cpp index ff2d3aa1d..bf11d2247 100644 --- a/src/blackmisc/iconlist.cpp +++ b/src/blackmisc/iconlist.cpp @@ -187,14 +187,4 @@ namespace BlackMisc }); return icons; } - - const CIcon &CIconList::iconByIndex(CIcons::IconIndex index) - { - return CIcon::iconByIndex(index); - } - - const CIcon &CIconList::iconByIndex(int index) - { - return CIcon::iconByIndex(index); - } } // ns diff --git a/src/blackmisc/iconlist.h b/src/blackmisc/iconlist.h index bc435d075..932807807 100644 --- a/src/blackmisc/iconlist.h +++ b/src/blackmisc/iconlist.h @@ -27,9 +27,8 @@ namespace BlackMisc { - /*! - * Icon + * Icon list (swift standard icons) */ class BLACKMISC_EXPORT CIconList : public CSequence { @@ -48,14 +47,6 @@ namespace BlackMisc //! All icons static const CIconList &allIcons(); - - //! Icon for given index - //! \deprecated Use CIcon::iconByIndex instead. - static const CIcon &iconByIndex(CIcons::IconIndex index); - - //! Icon for given index - //! \deprecated Use CIcon::iconByIndex instead. - static const CIcon &iconByIndex(int index); }; } diff --git a/src/blackmisc/namevariantpair.cpp b/src/blackmisc/namevariantpair.cpp index 83ee4c739..543a28ce7 100644 --- a/src/blackmisc/namevariantpair.cpp +++ b/src/blackmisc/namevariantpair.cpp @@ -7,11 +7,8 @@ * contained in the LICENSE file. */ -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include "blackmisc/namevariantpair.h" #include "blackmisc/propertyindexvariantmap.h" - #include namespace BlackMisc @@ -61,7 +58,7 @@ namespace BlackMisc if (static_cast(variant.type()) == QMetaType::Int) { CIcons::IconIndex iconIndex = variant.value(); - this->m_icon = CIconList::iconByIndex(iconIndex); + this->m_icon = CIcon::iconByIndex(iconIndex); } else { diff --git a/src/blackmisc/network/authenticateduser.cpp b/src/blackmisc/network/authenticateduser.cpp index e7d594dfc..f491ef0b9 100644 --- a/src/blackmisc/network/authenticateduser.cpp +++ b/src/blackmisc/network/authenticateduser.cpp @@ -8,7 +8,6 @@ */ #include "blackmisc/network/authenticateduser.h" -#include "blackmisc/iconlist.h" #include "blackmisc/icons.h" #include "blackmisc/logcategory.h" #include "blackmisc/logcategorylist.h" @@ -120,7 +119,7 @@ namespace BlackMisc CIcon CAuthenticatedUser::toIcon() const { - return CIconList::iconByIndex(CIcons::StandardIconUser16); + return CIcon::iconByIndex(CIcons::StandardIconUser16); } CVariant CAuthenticatedUser::propertyByIndex(const BlackMisc::CPropertyIndex &index) const diff --git a/src/blackmisc/network/voicecapabilites.cpp b/src/blackmisc/network/voicecapabilites.cpp index 2e79fc08a..097e8cf93 100644 --- a/src/blackmisc/network/voicecapabilites.cpp +++ b/src/blackmisc/network/voicecapabilites.cpp @@ -93,18 +93,18 @@ namespace BlackMisc switch (this->m_voiceCapabilities) { case Voice: - return CIconList::iconByIndex(CIcons::NetworkCapabilityVoiceBackground); + return CIcon::iconByIndex(CIcons::NetworkCapabilityVoiceBackground); case TextOnly: - return CIconList::iconByIndex(CIcons::NetworkCapabilityTextOnly); + return CIcon::iconByIndex(CIcons::NetworkCapabilityTextOnly); case Unknown: - return CIconList::iconByIndex(CIcons::NetworkCapabilityUnknown); + return CIcon::iconByIndex(CIcons::NetworkCapabilityUnknown); case VoiceReceivingOnly: - return CIconList::iconByIndex(CIcons::NetworkCapabilityVoiceReceiveOnlyBackground); + return CIcon::iconByIndex(CIcons::NetworkCapabilityVoiceReceiveOnlyBackground); default: break; } Q_ASSERT(false); - return CIconList::iconByIndex(CIcons::NetworkCapabilityUnknown); // never reached + return CIcon::iconByIndex(CIcons::NetworkCapabilityUnknown); // never reached } const CVoiceCapabilities &CVoiceCapabilities::fromVoiceCapabilities(CVoiceCapabilities::VoiceCapabilities capabilities) diff --git a/src/blackmisc/pq/angle.cpp b/src/blackmisc/pq/angle.cpp index effd37d2f..ccd3bbe78 100644 --- a/src/blackmisc/pq/angle.cpp +++ b/src/blackmisc/pq/angle.cpp @@ -20,7 +20,7 @@ namespace BlackMisc { BlackMisc::CIcon CAngle::toIcon() const { - BlackMisc::CIcon i = CIconList::iconByIndex(CIcons::StandardIconArrowMediumNorth16); + BlackMisc::CIcon i = CIcon::iconByIndex(CIcons::StandardIconArrowMediumNorth16); i.setRotation(*this); return i; } diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index a55c16c2a..412e50e51 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -10,9 +10,6 @@ #include "blackmisc/compare.h" #include "blackmisc/comparefunctions.h" #include "blackmisc/db/datastoreutility.h" -#include "blackmisc/icon.h" -#include "blackmisc/iconlist.h" -#include "blackmisc/icons.h" #include "blackmisc/fileutils.h" #include "blackmisc/logcategory.h" #include "blackmisc/logcategorylist.h" @@ -458,16 +455,16 @@ namespace BlackMisc switch (this->getModelMode()) { case Include: - return CIconList::iconByIndex(CIcons::ModelInclude); + return CIcon::iconByIndex(CIcons::ModelInclude); case Exclude: - return CIconList::iconByIndex(CIcons::ModelExclude); + return CIcon::iconByIndex(CIcons::ModelExclude); case Undefined: - return CIconList::iconByIndex(CIcons::StandardIconUnknown16); + return CIcon::iconByIndex(CIcons::StandardIconUnknown16); default: Q_ASSERT_X(false, Q_FUNC_INFO, "wrong mode"); break; } - return CIconList::iconByIndex(CIcons::ModelInclude); + return CIcon::iconByIndex(CIcons::ModelInclude); } void CAircraftModel::setModelModeAsString(const QString &mode) diff --git a/src/blackmisc/statusmessage.cpp b/src/blackmisc/statusmessage.cpp index 8d8628dd0..d9acdd2ef 100644 --- a/src/blackmisc/statusmessage.cpp +++ b/src/blackmisc/statusmessage.cpp @@ -287,11 +287,11 @@ namespace BlackMisc { switch (severity) { - case SeverityDebug: return CIconList::iconByIndex(CIcons::StandardIconUnknown16); // TODO - case SeverityInfo: return CIconList::iconByIndex(CIcons::StandardIconInfo16); - case SeverityWarning: return CIconList::iconByIndex(CIcons::StandardIconWarning16); - case SeverityError: return CIconList::iconByIndex(CIcons::StandardIconError16); - default: return CIconList::iconByIndex(CIcons::StandardIconInfo16); + case SeverityDebug: return CIcon::iconByIndex(CIcons::StandardIconUnknown16); // TODO + case SeverityInfo: return CIcon::iconByIndex(CIcons::StandardIconInfo16); + case SeverityWarning: return CIcon::iconByIndex(CIcons::StandardIconWarning16); + case SeverityError: return CIcon::iconByIndex(CIcons::StandardIconError16); + default: return CIcon::iconByIndex(CIcons::StandardIconInfo16); } }