mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Removed deprecated funtions and changed code to use new functions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
bac77e233d
commit
9eff387207
@@ -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);
|
||||
|
||||
@@ -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) :
|
||||
|
||||
@@ -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 <QAction>
|
||||
@@ -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);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackMisc
|
||||
|
||||
CIcon CAltitude::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIconList::iconByIndex(CIcons::GeoPosition);
|
||||
return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/icons.h"
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <QDateTime>
|
||||
#include <QtGlobal>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <class LATorLON>
|
||||
CIcon CEarthAngle<LATorLON>::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIconList::iconByIndex(CIcons::GeoPosition);
|
||||
return BlackMisc::CIcon::iconByIndex(CIcons::GeoPosition);
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
/*!
|
||||
* Icon
|
||||
* Icon list (swift standard icons)
|
||||
*/
|
||||
class BLACKMISC_EXPORT CIconList : public CSequence<CIcon>
|
||||
{
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -61,7 +58,7 @@ namespace BlackMisc
|
||||
if (static_cast<QMetaType::Type>(variant.type()) == QMetaType::Int)
|
||||
{
|
||||
CIcons::IconIndex iconIndex = variant.value<CIcons::IconIndex>();
|
||||
this->m_icon = CIconList::iconByIndex(iconIndex);
|
||||
this->m_icon = CIcon::iconByIndex(iconIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user