[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/dataengines/weather/ions
From:       Shawn Starr <shawn.starr () rogers ! com>
Date:       2009-02-10 5:57:51
Message-ID: 1234245471.128071.5704.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 924105 by spstarr:

Add missing conversions between Kilometers/Miles when measuring visibility. Fix up \
enums for wind speed. Wrong ones used

 M  +15 -2     weatherutils.cpp  


--- trunk/KDE/kdebase/workspace/plasma/dataengines/weather/ions/weatherutils.cpp \
#924104:924105 @@ -67,6 +67,19 @@
         return value;
 
     switch(srcUnit) {
+
+        case WeatherUtils::Kilometers:
+            switch (destUnit) {
+            case WeatherUtils::Miles:
+                return (value * 0.621371192);
+            };
+
+        case WeatherUtils::Miles:
+            switch (destUnit) {
+            case WeatherUtils::Kilometers:
+                return (value * 1.609344);
+            };
+
         case WeatherUtils::Centimeters:
             switch (destUnit) {
             case WeatherUtils::Millimeters:
@@ -142,9 +155,9 @@
 
         case WeatherUtils::Knots:
             switch (destUnit) {
-            case WeatherUtils::Kilometers:
+            case WeatherUtils::KilometersPerHour:
                 return floor(value * 1.852 + 0.5);
-            case WeatherUtils::Miles:
+            case WeatherUtils::MilesPerHour:
                 return (value * 1.507794);
             case WeatherUtils::MetersPerSecond:
                 return (value * 1.9438);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic