diff --git a/src/Airports/airport.cxx b/src/Airports/airport.cxx index b5ea39c1a..a565e713a 100644 --- a/src/Airports/airport.cxx +++ b/src/Airports/airport.cxx @@ -107,12 +107,6 @@ bool FGAirport::isHeliport() const return type() == HELIPORT; } -// Static method -bool FGAirport::isAirportType(FGPositioned* pos) -{ - return FGPositioned::isAirportType(pos); -} - //------------------------------------------------------------------------------ unsigned int FGAirport::numRunways() const { diff --git a/src/Airports/airport.hxx b/src/Airports/airport.hxx index bf5832de2..bd145b310 100644 --- a/src/Airports/airport.hxx +++ b/src/Airports/airport.hxx @@ -74,10 +74,6 @@ class FGAirport : public FGPositioned return mIsClosed; } - // True for the following types: AIRPORT, HELIPORT, SEAPORT. - // False for other types, as well as if pos == nullptr. - static bool isAirportType(FGPositioned* pos); - virtual const std::string& name() const { return _name; } diff --git a/src/GUI/BaseDiagram.cxx b/src/GUI/BaseDiagram.cxx index fc714e71c..4395ac35d 100644 --- a/src/GUI/BaseDiagram.cxx +++ b/src/GUI/BaseDiagram.cxx @@ -254,7 +254,7 @@ void BaseDiagram::splitItems(const FGPositionedList& in, FGPositionedList& navai { FGPositionedList::const_iterator it = in.begin(); for (; it != in.end(); ++it) { - if (FGAirport::isAirportType(it->ptr())) { + if (FGPositioned::isAirportType(it->ptr())) { ports.push_back(*it); } else { navaids.push_back(*it); @@ -370,7 +370,7 @@ void BaseDiagram::paintNavaid(QPainter* painter, const QTransform& t, const FGPo // compute label text so we can measure it QString label; - if (FGAirport::isAirportType(pos.ptr())) { + if (FGPositioned::isAirportType(pos.ptr())) { label = QString::fromStdString(pos->name()); label = fixNavaidName(label); } else { @@ -685,7 +685,7 @@ QPixmap BaseDiagram::iconForPositioned(const FGPositionedRef& pos, bool small = options.testFlag(SmallIcons); bool isTowered = false; - if (FGAirport::isAirportType(pos)) { + if (FGPositioned::isAirportType(pos.ptr())) { FGAirport* apt = static_cast(pos.ptr()); isTowered = apt->hasTower(); } diff --git a/src/GUI/LocationWidget.cxx b/src/GUI/LocationWidget.cxx index d59e12f86..94dc9a3af 100644 --- a/src/GUI/LocationWidget.cxx +++ b/src/GUI/LocationWidget.cxx @@ -463,7 +463,7 @@ void LocationWidget::restoreLocation(QVariantMap l) // now we've loaded airport location data (potentially), we can apply // more settings - if (FGAirport::isAirportType(m_location.ptr())) { + if (FGPositioned::isAirportType(m_location.ptr())) { if (l.contains("location-apt-runway")) { QString runway = l.value("location-apt-runway").toString(); int index = m_ui->runwayCombo->findText(runway); @@ -494,7 +494,7 @@ bool LocationWidget::shouldStartPaused() const return false; // defaults to on-ground at KSFO } - if (FGAirport::isAirportType(m_location.ptr())) { + if (FGPositioned::isAirportType(m_location.ptr())) { return m_ui->onFinalCheckbox->isChecked(); } else { // navaid, start paused @@ -511,7 +511,7 @@ QVariantMap LocationWidget::saveLocation() const } else if (m_location) { locationSet.insert("location-id", static_cast(m_location->guid())); - if (FGAirport::isAirportType(m_location.ptr())) { + if (FGPositioned::isAirportType(m_location.ptr())) { locationSet.insert("location-on-final", m_ui->onFinalCheckbox->isChecked()); locationSet.insert("location-apt-final-distance", m_ui->approachDistanceSpin->value()); if (m_ui->runwayRadio->isChecked()) { @@ -574,7 +574,7 @@ void LocationWidget::setLocationProperties() return; } - if (FGAirport::isAirportType(m_location.ptr())) { + if (FGPositioned::isAirportType(m_location.ptr())) { FGAirport* apt = static_cast(m_location.ptr()); fgSetString("/sim/presets/airport-id", apt->ident()); fgSetBool("/sim/presets/on-ground", true); @@ -685,7 +685,7 @@ void LocationWidget::onCollectConfig() return; } - if (FGAirport::isAirportType(m_location.ptr())) { + if (FGPositioned::isAirportType(m_location.ptr())) { FGAirport* apt = static_cast(m_location.ptr()); m_config->setArg("airport", QString::fromStdString(apt->ident())); @@ -814,7 +814,7 @@ void LocationWidget::onSearchComplete() void LocationWidget::onLocationChanged() { - bool locIsAirport = FGAirport::isAirportType(m_location.ptr()); + bool locIsAirport = FGPositioned::isAirportType(m_location.ptr()); if (!m_location) { onBackToSearch(); return; @@ -951,7 +951,7 @@ QString LocationWidget::locationDescription() const return tr("No location selected"); } - bool locIsAirport = FGAirport::isAirportType(m_location.ptr()); + bool locIsAirport = FGPositioned::isAirportType(m_location.ptr()); QString ident = QString::fromStdString(m_location->ident()), name = QString::fromStdString(m_location->name()); @@ -1009,7 +1009,7 @@ QString LocationWidget::locationDescription() const void LocationWidget::updateDescription() { - bool locIsAirport = FGAirport::isAirportType(m_location.ptr()); + bool locIsAirport = FGPositioned::isAirportType(m_location.ptr()); if (locIsAirport) { FGAirport* apt = static_cast(m_location.ptr());