Not possible to use temperatures below 0 ?

Thiago Macieira thiago at macieira.org
Thu Nov 28 10:39:58 UTC 2013


On quinta-feira, 28 de novembro de 2013 10:34:48, Linus Torvalds wrote:
> On Thu, Nov 28, 2013 at 3:14 AM, Lubomir I. Ivanov <neolit123 at gmail.com> 
wrote:
> > only positive values seem to reach get_temperature_string(), while
> > mkelvin_to_C() looks OK to me.
> > so perhaps the text field is ignoring the minus sign...
> 
> I think it's parseTemperatureToMkelvin(). It does this:
> 
>         QString numOnly = text;
>         numOnly.replace(",",".").remove(QRegExp("[^0-9.]"));
> 
> and I think the "remove(QRegExp("[^0-9.]") will remove the sign character.
> 
> Does adding a "-" to the end of that regex string fix it? Dirk, this
> is all your code (commit a8888eaf26c9)..

Tomaz,

the temperature widgets are QLineEdit. Should we instead use QDoubleSpinBox? 
That will avoid the above problem by having Qt handle the number and the 
locale-specific decimal.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131128/010036e7/attachment.sig>


More information about the subsurface mailing list