]> git.mxchange.org Git - flightgear.git/commitdiff
Lat-lon startup location fixes.
authorJames Turner <zakalawe@mac.com>
Sat, 21 Nov 2015 00:01:40 +0000 (00:01 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 23 Nov 2015 00:48:21 +0000 (00:48 +0000)
src/GUI/LocationWidget.cxx

index 533c76623d5313138f2600dbcc3663ef7da9d8f2..cb6479878d6c883c3d816fbc4ad9ca820743d84a 100644 (file)
@@ -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;