← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/ubuntu-weather-app/fix-link-windspeed-to-windunits-not-tempunits into lp:ubuntu-weather-app/reboot

 

Andrew Hayzen has proposed merging lp:~ahayzen/ubuntu-weather-app/fix-link-windspeed-to-windunits-not-tempunits into lp:ubuntu-weather-app/reboot.

Commit message:
* Fix to link the Wind Speed unit to the Wind Unit setting and not the Temperature Unit setting

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~ahayzen/ubuntu-weather-app/fix-link-windspeed-to-windunits-not-tempunits/+merge/275369

* Fix to link the Wind Speed unit to the Wind Unit setting and not the Temperature Unit setting
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~ahayzen/ubuntu-weather-app/fix-link-windspeed-to-windunits-not-tempunits into lp:ubuntu-weather-app/reboot.
=== modified file 'app/ui/LocationPane.qml'
--- app/ui/LocationPane.qml	2015-10-20 01:37:58 +0000
+++ app/ui/LocationPane.qml	2015-10-22 15:18:04 +0000
@@ -140,6 +140,7 @@
 
     function getDayData(data) {
         var tempUnits = settings.tempScale === "°C" ? "metric" : "imperial"
+        var windUnits = settings.windUnits === "kph" ? "metric" : "imperial";
         var timezoneOffset = new Date().getTimezoneOffset();
         var offset = (data.location.timezone && data.location.timezone.dstOffset !== undefined) ? (data.location.timezone.dstOffset*60 + timezoneOffset)*60*1000: 0
         var options = { timeZone: data.location.timezone.timeZoneId, timeZoneName: 'long' };
@@ -157,8 +158,8 @@
             sunrise: data.sunrise || sunrise.toLocaleTimeString(Qt.locale().name, options),
             sunset: data.sunset || sunset.toLocaleTimeString(Qt.locale().name, options),
             uvIndex: emptyIfUndefined(data.uv),
-            wind: data[tempUnits].windSpeed === undefined || data.windDir === undefined
-                        ? "" : Math.round(data[tempUnits].windSpeed) + settings.windUnits + " " + data.windDir
+            wind: data[windUnits].windSpeed === undefined || data.windDir === undefined
+                        ? "" : Math.round(data[windUnits].windSpeed) + settings.windUnits + " " + data.windDir
         };
     }
 

=== modified file 'debian/changelog'
--- debian/changelog	2015-10-22 12:49:35 +0000
+++ debian/changelog	2015-10-22 15:18:04 +0000
@@ -59,6 +59,7 @@
   * Add autopilot test for expanding the today info
   * Implement extra info expandable for today info (LP: #1496422, LP: #1478255)
   * Fix for autopilot tests not using custom back button and for possible flaky test due to expandHeight changing dynamically
+  * Fix to link the Wind Speed unit to the Wind Unit setting and not the Temperature Unit setting
 
   [ Carla Sella ]
   * Create autopilot test which shows the day delegate (LP: #1452491)

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2015-10-22 12:49:35 +0000
+++ po/com.ubuntu.weather.pot	2015-10-22 15:18:04 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: ubuntu-weather-app\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-10-22 13:33+0100\n"
+"POT-Creation-Date: 2015-10-22 16:15+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"