aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-20 22:00:07 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-20 22:00:07 -0800
commita550467e8b68d8d788cef056610f6dbd360f0072 (patch)
tree259dfef378a56a9607d8700731643386e5d12049 /subsurface-core
parent8b39352d4ebae623e8956354cdbf2678fbfcb71e (diff)
downloadsubsurface-a550467e8b68d8d788cef056610f6dbd360f0072.tar.gz
QML UI: make unit matching case insensitive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r--subsurface-core/qthelper.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index 8afb7ed74..5c48573cc 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -794,9 +794,9 @@ int parseLengthToMm(const QString &text)
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
- if (text.contains(QObject::tr("m"))) {
+ if (text.contains(QObject::tr("m"), Qt::CaseInsensitive)) {
mm = number * 1000;
- } else if (text.contains(QObject::tr("ft"))) {
+ } else if (text.contains(QObject::tr("ft"), Qt::CaseInsensitive)) {
mm = feet_to_mm(number);
} else {
switch (prefs.units.length) {
@@ -822,9 +822,9 @@ int parseTemperatureToMkelvin(const QString &text)
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
- if (text.contains(QObject::tr("C"))) {
+ if (text.contains(QObject::tr("C"), Qt::CaseInsensitive)) {
mkelvin = C_to_mkelvin(number);
- } else if (text.contains(QObject::tr("F"))) {
+ } else if (text.contains(QObject::tr("F"), Qt::CaseInsensitive)) {
mkelvin = F_to_mkelvin(number);
} else {
switch (prefs.units.temperature) {
@@ -849,9 +849,9 @@ int parseWeightToGrams(const QString &text)
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
- if (text.contains(QObject::tr("kg"))) {
+ if (text.contains(QObject::tr("kg"), Qt::CaseInsensitive)) {
grams = rint(number * 1000);
- } else if (text.contains(QObject::tr("lbs"))) {
+ } else if (text.contains(QObject::tr("lbs"), Qt::CaseInsensitive)) {
grams = lbs_to_grams(number);
} else {
switch (prefs.units.weight) {
@@ -876,9 +876,9 @@ int parsePressureToMbar(const QString &text)
if (numOnly.isEmpty())
return 0;
double number = numOnly.toDouble();
- if (text.contains(QObject::tr("bar"))) {
+ if (text.contains(QObject::tr("bar"), Qt::CaseInsensitive)) {
mbar = rint(number * 1000);
- } else if (text.contains(QObject::tr("psi"))) {
+ } else if (text.contains(QObject::tr("psi"), Qt::CaseInsensitive)) {
mbar = psi_to_mbar(number);
} else {
switch (prefs.units.pressure) {