From 789606cf86918828e187349948dbbd42519e6178 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20T=C5=AFma?= Date: Sun, 31 Dec 2023 13:57:43 +0100 Subject: [PATCH] Silenced some more clazy warnings --- src/data/dem.cpp | 2 +- src/data/gpsdumpparser.cpp | 2 +- src/map/ozimap.cpp | 2 +- src/map/rmap.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/dem.cpp b/src/data/dem.cpp index 5127dcac..93103f54 100644 --- a/src/data/dem.cpp +++ b/src/data/dem.cpp @@ -148,9 +148,9 @@ qreal DEM::elevation(const Coordinates &c) QList DEM::tiles() { + static const QRegularExpression re("([NS])([0-9]{2})([EW])([0-9]{3})"); QDir dir(_dir); QFileInfoList files(dir.entryInfoList(QDir::Files | QDir::Readable)); - QRegularExpression re("([NS])([0-9]{2})([EW])([0-9]{3})"); QLocale l(QLocale::system()); QList list; diff --git a/src/data/gpsdumpparser.cpp b/src/data/gpsdumpparser.cpp index bb22fc2f..c5545c94 100644 --- a/src/data/gpsdumpparser.cpp +++ b/src/data/gpsdumpparser.cpp @@ -88,6 +88,7 @@ static Coordinates parseUTM(const QString &zone, const QString &easting, bool GPSDumpParser::parse(QFile *file, QList &tracks, QList &routes, QList &polygons, QVector &waypoints) { + static const QRegularExpression dm("[ ]{2,}"); Q_UNUSED(tracks); Q_UNUSED(routes); Q_UNUSED(polygons); @@ -95,7 +96,6 @@ bool GPSDumpParser::parse(QFile *file, QList &tracks, _errorLine = 1; _errorString.clear(); Type type = Unknown; - QRegularExpression dm("[ ]{2,}"); while (!file->atEnd()) { QByteArray ba(file->readLine(4096).trimmed()); diff --git a/src/map/ozimap.cpp b/src/map/ozimap.cpp index 9b30c371..68852f1a 100644 --- a/src/map/ozimap.cpp +++ b/src/map/ozimap.cpp @@ -262,7 +262,7 @@ bool OziMap::setImageInfo(const QString &path) bool OziMap::setTileInfo(const QStringList &tiles, const QString &path) { - static QRegularExpression rx("_[0-9]+_[0-9]+\\."); + static const QRegularExpression rx("_[0-9]+_[0-9]+\\."); if (!_map.size.isValid()) { _errorString = "Missing total image size (IWH)"; diff --git a/src/map/rmap.cpp b/src/map/rmap.cpp index b63d6215..86a12b26 100644 --- a/src/map/rmap.cpp +++ b/src/map/rmap.cpp @@ -97,10 +97,10 @@ static Projection parseProjection(const QString &str, const GCS &gcs) bool RMap::parseIMP(const QByteArray &data) { - QStringList lines = QString(data).split("\r\n"); + static const QRegularExpression re("^P[0-9]+="); + QStringList lines(QString(data).split("\r\n")); QVector calibrationPoints; QString projection, datum; - QRegularExpression re("^P[0-9]+="); for (int i = 0; i < lines.count(); i++) { const QString &line = lines.at(i); -- 2.11.4.GIT