From: James Turner Date: Sat, 21 Nov 2015 00:01:40 +0000 (+0000) Subject: Lat-lon startup location fixes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=579881322e53765c13b32f722d2c0f90b0190bba;p=flightgear.git Lat-lon startup location fixes. --- diff --git a/src/GUI/LocationWidget.cxx b/src/GUI/LocationWidget.cxx index 533c76623..cb6479878 100644 --- a/src/GUI/LocationWidget.cxx +++ b/src/GUI/LocationWidget.cxx @@ -344,11 +344,11 @@ private: LocationWidget::LocationWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::LocationWidget), + m_locationIsLatLon(false), m_aircraftType(Airplane) { m_ui->setupUi(this); - QIcon historyIcon(":/history-icon"); m_ui->searchHistory->setIcon(historyIcon); @@ -426,6 +426,7 @@ void LocationWidget::restoreSettings() settings.value("location-lat").toDouble()); } else if (settings.contains("location-id")) { m_location = NavDataCache::instance()->loadById(settings.value("location-id").toULongLong()); + m_locationIsLatLon = false; } m_ui->altitudeSpinbox->setValue(settings.value("altitude", 6000).toInt()); @@ -463,6 +464,8 @@ void LocationWidget::saveSettings() QSettings settings; settings.remove("location-id"); + settings.remove("location-lon"); + settings.remove("location-lat"); if (m_locationIsLatLon) { settings.setValue("location-lat", m_geodLocation.getLatitudeDeg()); settings.setValue("location-lon", m_geodLocation.getLongitudeDeg()); @@ -885,6 +888,7 @@ void LocationWidget::onShowHistory() void LocationWidget::setBaseLocation(FGPositionedRef ref) { + m_locationIsLatLon = false; if (m_location == ref) return;