diff --git a/src/GUI/pluginparameters.cpp b/src/GUI/pluginparameters.cpp index 222ebcea..95cce959 100644 --- a/src/GUI/pluginparameters.cpp +++ b/src/GUI/pluginparameters.cpp @@ -2,12 +2,6 @@ #include #include "pluginparameters.h" -static const QMap pluginParams = { - {"nmea", {"nmea.source", "nmea.baudrate"}}, - {"serialnmea", {"serialnmea.serial_port"}}, - {"geoclue2", {"desktopId"}} -}; - static void deleteLayout(QLayout *layout) { if (!layout) @@ -32,6 +26,12 @@ PluginParameters::PluginParameters(const QString &plugin, void PluginParameters::setPlugin(const QString &plugin) { + static const QMap pluginParams = { + {"nmea", {"nmea.source", "nmea.baudrate"}}, + {"serialnmea", {"serialnmea.serial_port"}}, + {"geoclue2", {"desktopId"}} + }; + saveParameters(); QStringList params = pluginParams.value(plugin); diff --git a/src/map/ENC/iso8211.cpp b/src/map/ENC/iso8211.cpp index b81585c0..1ae28bc8 100644 --- a/src/map/ENC/iso8211.cpp +++ b/src/map/ENC/iso8211.cpp @@ -323,7 +323,7 @@ bool ISO8211::readRecord(Record &record) const FieldDefinition &def = fields.at(i); Data data; - FieldsMap::const_iterator it = _map.find(def.tag); + FieldsMap::const_iterator it(_map.find(def.tag)); if (it == _map.constEnd()) { _errorString = QString("%1: unknown record").arg(QString(def.tag)); return false; diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index 644b7a08..c460a087 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -86,7 +86,7 @@ static QMap orderMap = orderMapInit(); static uint order(uint type) { uint st = ((type>>16) == BUAARE) ? type : (type & 0xFFFF0000); - QMap::const_iterator it = orderMap.find(st); + QMap::const_iterator it(orderMap.find(st)); return (it == orderMap.constEnd()) ? (type>>16) + 512 : it.value(); } diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index 6bd38977..0f20b9d2 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -15,7 +15,8 @@ using namespace ENC; typedef QSet PointSet; static const float C1 = 0.866025f; /* sqrt(3)/2 */ -static const QColor haloColor(Qt::white); +static const QColor tsslptPen = QColor("#eb49eb"); +static const QColor tsslptBrush = QColor("#80eb49eb"); static const Style *style() { @@ -174,8 +175,8 @@ void RasterTile::drawArrows(QPainter *painter, QPolygonF polygon(tsslptArrow(centroid(poly.path().first()), deg2rad(180 - poly.param().toDouble()))); - painter->setPen(QPen(QColor("#eb49eb"), 1)); - painter->setBrush(QBrush("#80eb49eb")); + painter->setPen(QPen(tsslptPen, 1)); + painter->setBrush(QBrush(tsslptBrush)); painter->drawPolygon(polygon); } } diff --git a/src/map/ENC/style.cpp b/src/map/ENC/style.cpp index a9f0d2c8..bb6b0f09 100644 --- a/src/map/ENC/style.cpp +++ b/src/map/ENC/style.cpp @@ -344,7 +344,7 @@ const Style::Line &Style::line(uint type) const { static Line null; - QMap::const_iterator it = _lines.find(type); + QMap::const_iterator it(_lines.find(type)); return (it == _lines.constEnd()) ? null : *it; } @@ -352,7 +352,7 @@ const Style::Polygon &Style::polygon(uint type) const { static Polygon null; - QMap::const_iterator it = _polygons.find(type); + QMap::const_iterator it(_polygons.find(type)); return (it == _polygons.constEnd()) ? null : *it; } @@ -360,7 +360,7 @@ const Style::Point &Style::point(uint type) const { static Point null; - QMap::const_iterator it = _points.find(type); + QMap::const_iterator it(_points.find(type)); return (it == _points.constEnd()) ? null : *it; } diff --git a/src/map/ENC/style.h b/src/map/ENC/style.h index 642e89f9..065bfeac 100644 --- a/src/map/ENC/style.h +++ b/src/map/ENC/style.h @@ -111,6 +111,7 @@ private: QMap _points; QVector _drawOrder; + /* Fonts and images must be initialized after QGuiApplication! */ QFont _small, _normal, _large; QImage _light, _signal; }; diff --git a/src/map/IMG/imgdata.cpp b/src/map/IMG/imgdata.cpp index 55b9435e..81672b3a 100644 --- a/src/map/IMG/imgdata.cpp +++ b/src/map/IMG/imgdata.cpp @@ -105,7 +105,7 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap) QByteArray fn(name, sizeof(name)); if (VectorTile::isTileFile(tt)) { VectorTile *tile; - TileMap::const_iterator it = tileMap.find(fn); + TileMap::const_iterator it(tileMap.find(fn)); if (it == tileMap.constEnd()) { tile = new VectorTile(); tileMap.insert(fn, tile); diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 3c7bb86a..8e6b8695 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -1,7 +1,6 @@ #include #include #include -#include "map/imgmap.h" #include "map/textpathitem.h" #include "map/textpointitem.h" #include "map/bitmapline.h" diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index 784559c6..5f7b8129 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -1250,7 +1250,7 @@ const Style::Line &Style::line(quint32 type) const { static Line null; - QMap::const_iterator it = _lines.find(type); + QMap::const_iterator it(_lines.find(type)); return (it == _lines.constEnd()) ? null : *it; } @@ -1258,7 +1258,7 @@ const Style::Polygon &Style::polygon(quint32 type) const { static Polygon null; - QMap::const_iterator it = _polygons.find(type); + QMap::const_iterator it(_polygons.find(type)); return (it == _polygons.constEnd()) ? null : *it; } @@ -1266,7 +1266,7 @@ const Style::Point &Style::point(quint32 type) const { static Point null; - QMap::const_iterator it = _points.find(type); + QMap::const_iterator it(_points.find(type)); return (it == _points.constEnd()) ? null : *it; } diff --git a/src/map/IMG/style.h b/src/map/IMG/style.h index 8a5665c1..1e3775ea 100644 --- a/src/map/IMG/style.h +++ b/src/map/IMG/style.h @@ -176,6 +176,7 @@ private: QMap _points; QList _drawOrder; + /* Fonts and images must be initialized after QGuiApplication! */ QFont _large, _normal, _small, _extraSmall; }; diff --git a/src/map/conversion.cpp b/src/map/conversion.cpp index 054f5db6..ce177c22 100644 --- a/src/map/conversion.cpp +++ b/src/map/conversion.cpp @@ -99,7 +99,7 @@ QMap Conversion::defaults() Conversion Conversion::conversion(int id) { - QMap::const_iterator it = _conversions.find(id); + QMap::const_iterator it(_conversions.find(id)); if (it == _conversions.constEnd()) return Conversion(); @@ -189,7 +189,7 @@ QList > Conversion::list() QList > list; for (QMap::const_iterator it = _conversions.constBegin(); - it != _conversions.constEnd(); ++it) + it != _conversions.constEnd(); ++it) list.append(KV(it.key(), it.value().name())); return list; diff --git a/src/map/pcs.cpp b/src/map/pcs.cpp index d9210499..f5f3a1b5 100644 --- a/src/map/pcs.cpp +++ b/src/map/pcs.cpp @@ -1,6 +1,5 @@ #include #include "common/csv.h" -#include "angularunits.h" #include "pcs.h" QMap PCS::_pcss = defaults(); @@ -14,7 +13,7 @@ QMap PCS::defaults() PCS PCS::pcs(int id) { - QMap::const_iterator it = _pcss.find(id); + QMap::const_iterator it(_pcss.find(id)); if (it == _pcss.constEnd()) return PCS(); diff --git a/src/map/rmap.cpp b/src/map/rmap.cpp index 2cf4767f..b63d6215 100644 --- a/src/map/rmap.cpp +++ b/src/map/rmap.cpp @@ -5,7 +5,6 @@ #include #include #include "common/rectc.h" -#include "common/wgs84.h" #include "common/color.h" #include "calibrationpoint.h" #include "utm.h" diff --git a/src/map/textpointitem.h b/src/map/textpointitem.h index a42ffb03..7bd53ef2 100644 --- a/src/map/textpointitem.h +++ b/src/map/textpointitem.h @@ -1,6 +1,7 @@ #ifndef TEXTPOINTITEM_H #define TEXTPOINTITEM_H +#include #include "textitem.h" class QFont; diff --git a/src/map/tileloader.cpp b/src/map/tileloader.cpp index 036ae439..e10b7e9f 100644 --- a/src/map/tileloader.cpp +++ b/src/map/tileloader.cpp @@ -110,8 +110,8 @@ void TileLoader::loadTilesSync(QVector &list) for (int i = 0; i < tl.size(); i++) { Tile *t = tl[i]; - QString file = tileFile(*t); - if (QFileInfo(file).exists()) + QString file(tileFile(*t)); + if (QFileInfo::exists(file)) t->setFile(file); } } diff --git a/src/map/transform.cpp b/src/map/transform.cpp index ec84ee74..59313b04 100644 --- a/src/map/transform.cpp +++ b/src/map/transform.cpp @@ -1,4 +1,3 @@ -#include "projection.h" #include "matrix.h" #include "transform.h" diff --git a/src/map/wms.cpp b/src/map/wms.cpp index ba336abc..63f88baf 100644 --- a/src/map/wms.cpp +++ b/src/map/wms.cpp @@ -321,7 +321,7 @@ bool WMS::parseCapabilities() void WMS::capabilitiesReady() { - if (!QFileInfo(_path).exists()) { + if (!QFileInfo::exists(_path)) { _errorString = "Error downloading capabilities XML file"; _valid = false; } else { @@ -338,7 +338,7 @@ WMS::WMS(const QString &file, const WMS::Setup &setup, QObject *parent) QString url = QString("%1%2service=WMS&request=GetCapabilities") .arg(setup.url(), setup.url().contains('?') ? "&" : "?"); - if (!QFileInfo(file).exists()) { + if (!QFileInfo::exists(file)) { Downloader *downloader = new Downloader(this); connect(downloader, &Downloader::finished, this, &WMS::capabilitiesReady); diff --git a/src/map/wmts.cpp b/src/map/wmts.cpp index 14f112bd..02d0a770 100644 --- a/src/map/wmts.cpp +++ b/src/map/wmts.cpp @@ -6,7 +6,6 @@ #include #include #include -#include "pcs.h" #include "crs.h" #include "wmts.h" @@ -301,7 +300,7 @@ bool WMTS::parseCapabilities(CTX &ctx) void WMTS::capabilitiesReady() { - if (!QFileInfo(_path).exists()) { + if (!QFileInfo::exists(_path)) { _errorString = "Error downloading capabilities XML file"; _valid = false; } else { @@ -354,7 +353,7 @@ WMTS::WMTS(const QString &file, const WMTS::Setup &setup, QObject *parent) _path = url.isLocalFile() ? url.toLocalFile() : file; - if (!url.isLocalFile() && !QFileInfo(file).exists()) { + if (!url.isLocalFile() && !QFileInfo::exists(file)) { Downloader *downloader = new Downloader(this); connect(downloader, &Downloader::finished, this, &WMTS::capabilitiesReady);