Bug 91287

Summary: Fahrenheit Celsius are Reversed
Product: [Applications] kalzium Reporter: Jeff Kendall <jeff_kendall>
Component: generalAssignee: Carsten Niehaus <cniehaus>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jeff Kendall 2004-10-14 05:33:59 UTC
Version:           1.2 (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.4 20040623 CFLAGS="-mcpu=athlon-xp -march=athlon-xp -mmmx -m3dnow -msse -pipe -funroll-loops -O3"
OS:                Linux

Under the miscellaneous settings, if "Use Degrees Fahrenheit" is selected, the temperatures are reported in celsius.  As well, if "Use Degrees Celsius" is selected, the temperatures are reported in fahrenheit.  These values are reported incorrectly in the Energy Information section, for each element.  It is expected that selecting celsius, would display values in celsius, and vice-versa.
Comment 1 Anne-Marie Mahfouf 2004-10-17 03:19:03 UTC
CVS commit by annma: 

fix bug 91287
BUG:91287
CCMAIL=cniehaus@kde.org


  M +6 -6      element.cpp   1.7


--- kdeedu/kalzium/src/element.cpp  #1.6:1.7
@@ -110,13 +110,13 @@ const QString Element::adjustUnits( doub
                                         v.append( "K" );
                                         break;
-                                case 1:// Kelvin to Fahrenheit
-                                        val = val * 1.8 - 459.67;
+                                case 1://Kelvin to Celsius
+                                        val-=273.15;
                                         v = QString::number( val );
-                                        v.append( "F" );
+                                        v.append( "C" );
                                         break;
-                                case 2: //Kelvin to Celsius
-                                        val-=273.15;
+                                case 2: // Kelvin to Fahrenheit
+                                        val = val * 1.8 - 459.67;
                                         v = QString::number( val );
-                                        v.append( "