Merge lp:~martin-borho/ubuntu-weather-app/current_temp_mixin into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Martin Borho
Status: Merged
Approved by: Raúl Yeguas
Approved revision: 61
Merged at revision: 64
Proposed branch: lp:~martin-borho/ubuntu-weather-app/current_temp_mixin
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 51 lines (+9/-8)
2 files modified
components/LocationTab.qml (+8/-7)
components/WeatherApi.js (+1/-1)
To merge this branch: bzr merge lp:~martin-borho/ubuntu-weather-app/current_temp_mixin
Reviewer Review Type Date Requested Status
Raúl Yeguas Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+174037@code.launchpad.net

Commit message

using min and max temperature daily-forecast for the current weather component to get more accurate values

Description of the change

* using min and max temperature from current days' daily-forecast for the current weather component to get more accurate values
* reflecting changes in the owm api search

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Raúl Yeguas (neokore) wrote :

A great improve that I didn't realize, before this change for my city it shows the same min temperature value as the max temperature.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/LocationTab.qml'
2--- components/LocationTab.qml 2013-07-10 13:46:10 +0000
3+++ components/LocationTab.qml 2013-07-10 20:02:32 +0000
4@@ -21,26 +21,27 @@
5 Component.onCompleted: {
6 var locData = mainView.locationsList[locationIndex],
7 currentData = locData.current.results,
8- units = (mainView.settings.units === 'imperial') ? 'imperial' : 'metric';
9+ units = (mainView.settings.units === 'imperial') ? 'imperial' : 'metric',
10+ dailyForecasts = locData.daily.results,
11+ dailyLength = dailyForecasts.length,
12+ todayForeCast = dailyForecasts[0];
13
14 // set location data as property
15 locationData = locData;
16
17 // set today date
18- var todayStr = formatTimestamp(currentData.timestamp, 'dddd, dd MMMM yyyy');
19- todayDateComponent.dateString = todayStr+" - "+ formatTimestampToTime(currentData.timestamp, 'HH:mm');
20+ todayDateComponent.dateString = formatTimestamp(currentData.timestamp, 'dddd, dd MMMM yyyy')+" - "
21+ + formatTimestampToTime(currentData.timestamp, 'HH:mm');
22 todayDateComponent.renderText()
23
24 // set current Condition
25 currentCondition.condition = currentData.condition.id;
26 currentCondition.icon = currentData.condition.icon;
27 currentCondition.currentTemp = currentData[units].temp;
28- currentCondition.minTemp = currentData[units].temp_min;
29- currentCondition.maxTemp = currentData[units].temp_max;
30+ currentCondition.minTemp = todayForeCast[units].min;
31+ currentCondition.maxTemp = todayForeCast[units].max;
32
33 // set daily forecasts
34- var dailyForecasts = locationData.daily.results,
35- dailyLength = dailyForecasts.length;
36 for(var x=1;x<dailyLength;x++) {
37 dayForecastModel.append({
38 dateRel: "",//Tomorrow",
39
40=== modified file 'components/WeatherApi.js'
41--- components/WeatherApi.js 2013-06-14 13:22:52 +0000
42+++ components/WeatherApi.js 2013-07-10 20:02:32 +0000
43@@ -32,7 +32,7 @@
44 service: "openweathermap",
45 service_id: r.id,
46 name: r.name,
47- coord: r.coords,
48+ coord: r.coord,
49 country: (r.sys && r.sys.country) ? r.sys.country : ""
50 });
51 })

Subscribers

People subscribed via source and target branches