Fix editing of negative temperatures

We tried to clean up the temperature string (to remove degree characters
and unit names etc) a bit too aggressively, and removed the sign
character too..

Fixes #306

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2013-11-28 10:44:22 -08:00 committed by Dirk Hohndel
parent a172bbef58
commit 38179f49d4

View file

@ -435,7 +435,7 @@ int parseTemperatureToMkelvin(const QString& text)
{
int mkelvin;
QString numOnly = text;
numOnly.replace(",",".").remove(QRegExp("[^0-9.]"));
numOnly.replace(",",".").remove(QRegExp("[^-0-9.]"));
if (numOnly == "")
return 0;
double number = numOnly.toDouble();