From fc40caf40ec564b25052f407164a532c55dc1b58 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 4 Aug 2021 09:51:23 +0100 Subject: [PATCH] Launcher: remove obsolete variable Also imrpvoe abandoning behaviour of the natural earth loader. --- src/GUI/QtLauncher.cxx | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index c92df7e20..cfc940228 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -212,8 +212,7 @@ class NaturalEarthDataLoaderThread : public QThread Q_OBJECT public: - NaturalEarthDataLoaderThread() : - m_lineInsertCount(0) + NaturalEarthDataLoaderThread() { connect(this, &QThread::finished, this, &NaturalEarthDataLoaderThread::onFinished); } @@ -225,10 +224,26 @@ public: protected: void run() override { - loadNaturalEarthFile("ne_10m_coastline.shp", flightgear::PolyLine::COASTLINE, false); - loadNaturalEarthFile("ne_10m_rivers_lake_centerlines.shp", flightgear::PolyLine::RIVER, false); - loadNaturalEarthFile("ne_10m_lakes.shp", flightgear::PolyLine::LAKE, true); - loadNaturalEarthFile("ne_10m_urban_areas.shp", flightgear::PolyLine::URBAN, true); + struct FileAndType { + std::string file; + flightgear::PolyLine::Type type; + bool closed = false; + }; + + const std::initializer_list files = { + {"ne_10m_coastline.shp", flightgear::PolyLine::COASTLINE, false}, + {"ne_10m_rivers_lake_centerlines.shp", flightgear::PolyLine::RIVER, false}, + {"ne_10m_lakes.shp", flightgear::PolyLine::LAKE, true}, + {"ne_10m_urban_areas.shp", flightgear::PolyLine::URBAN, true} + }; + + for (const auto& d : files) { + if (m_abandoned) { + break; + } + + loadNaturalEarthFile(d.file, d.type, d.closed); + } } private: @@ -256,7 +271,6 @@ private: } flightgear::PolyLineList m_parsedLines; - unsigned int m_lineInsertCount; bool m_abandoned = false; };