Merge lp:~vthompson/ubuntu-weather-app/reboot-default-OWM-blank-key into lp:ubuntu-weather-app

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 64
Merged at revision: 64
Proposed branch: lp:~vthompson/ubuntu-weather-app/reboot-default-OWM-blank-key
Merge into: lp:ubuntu-weather-app
Diff against target: 58 lines (+13/-1)
3 files modified
app/ubuntu-weather-app.qml (+4/-0)
app/ui/settings/DataProviderPage.qml (+8/-1)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/reboot-default-OWM-blank-key
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Andrew Hayzen Approve
Review via email: mp+265879@code.launchpad.net

Commit message

* Default to OWM if the key file for TWC is blank.

Description of the change

* Default to OWM if the key file for TWC is blank.

This MP defaults the app to OWM when the key is blank. I think this is the best solution for the app not working when the key isn't in the source tree.

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
Andrew Hayzen (ahayzen) wrote :

LGTM :-)

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
64. By Victor Thompson

Merge and resolve conflict

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Damn conflicts, reapproving :-)

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ubuntu-weather-app.qml'
2--- app/ubuntu-weather-app.qml 2015-06-28 19:04:43 +0000
3+++ app/ubuntu-weather-app.qml 2015-07-25 21:09:54 +0000
4@@ -153,6 +153,10 @@
5 units = metric ? "metric" : "imperial"
6 windUnits = metric ? "kph" : "mph"
7 }
8+
9+ if (Key.twcKey === "") { // No API key for TWC, so use OWM
10+ service = "openweathermap"
11+ }
12 }
13 }
14
15
16=== modified file 'app/ui/settings/DataProviderPage.qml'
17--- app/ui/settings/DataProviderPage.qml 2015-06-21 14:54:05 +0000
18+++ app/ui/settings/DataProviderPage.qml 2015-07-25 21:09:54 +0000
19@@ -19,6 +19,7 @@
20 import QtQuick 2.4
21 import Ubuntu.Components 1.2
22 import "../../components"
23+import "../../data/key.js" as Key
24
25 Page {
26 title: i18n.tr("Data Provider")
27@@ -26,7 +27,6 @@
28 ListModel {
29 id: dataProviderModel
30 ListElement { text: "OpenWeatherMap" }
31- ListElement { text: "The Weather Channel" }
32 }
33
34 ExpandableListItem {
35@@ -51,4 +51,11 @@
36 }
37 }
38 }
39+
40+ Component.onCompleted: {
41+ // If the key file for TWC is not blank, add the service to the model
42+ if (Key.twcKey !== "") {
43+ dataProviderModel.append({ text: "The Weather Channel" })
44+ }
45+ }
46 }
47
48=== modified file 'debian/changelog'
49--- debian/changelog 2015-07-18 20:59:12 +0000
50+++ debian/changelog 2015-07-25 21:09:54 +0000
51@@ -2,6 +2,7 @@
52
53 [ Victor Thompson ]
54 * Sync debian version with click version.
55+ * Default to OWM if the key file for TWC is blank.
56
57 [ Andrew Hayzen ]
58 * Add mocked locations for autopilot and add a test using the data

Subscribers

People subscribed via source and target branches

to all changes: