diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2019-04-01 23:15:23 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 12:59:17 +0300 |
commit | ee0acb0d4045bef68bdb153c76f8506c68d8ea9f (patch) | |
tree | ddc9d7ebf8e9abdb39a49a42bd2522277442cdac /core/qthelper.cpp | |
parent | c4c8094e32ad78dee558a80584470172f48c45b1 (diff) | |
download | subsurface-ee0acb0d4045bef68bdb153c76f8506c68d8ea9f.tar.gz |
use QStringLiteral for constants
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r-- | core/qthelper.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 3738e56f2..b3bf23691 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -39,7 +39,10 @@ const char *existing_filename; static QLocale loc; -static const QString DEGREE_SIGNS("dD" UTF8_DEGREE); +static inline QString degreeSigns() +{ + return QStringLiteral("dD\u00b0"); +} QString weight_string(int weight_in_grams) { @@ -160,7 +163,7 @@ static bool parseCoord(const QString& txt, int& pos, const QString& positives, } else if (others.indexOf(txt[pos]) >= 0) { //we are at the next coordinate. break; - } else if (DEGREE_SIGNS.indexOf(txt[pos]) >= 0 || + } else if (degreeSigns().indexOf(txt[pos]) >= 0 || (txt[pos].isSpace() && !degreesDefined && numberDefined)) { if (!numberDefined) return false; @@ -232,7 +235,7 @@ bool parseGpsText(const QString &gps_text, double *latitude, double *longitude) //remove the useless spaces (but keep the ones separating numbers) static const QRegExp SPACE_CLEANER("\\s*([" + POS_LAT + NEG_LAT + POS_LON + - NEG_LON + DEGREE_SIGNS + "'\"\\s])\\s*"); + NEG_LON + degreeSigns() + "'\"\\s])\\s*"); const QString normalized = gps_text.trimmed().toUpper().replace(SPACE_CLEANER, "\\1"); if (normalized.isEmpty()) { |