Merge lp:~nik90/ubuntu-clock-app/fix-for-1271736 into lp:ubuntu-clock-app/saucy

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 311
Merged at revision: 312
Proposed branch: lp:~nik90/ubuntu-clock-app/fix-for-1271736
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 47 lines (+17/-2)
2 files modified
clock/ClockPage.qml (+10/-0)
ubuntu-clock-app.qml (+7/-2)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/fix-for-1271736
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+203845@code.launchpad.net

Commit message

Update world clock times when app is brought from background or sleep

Description of the change

The world clock are generally updated every minute. However sometimes when the app is suspended, the world clock can show old time until the next minute. This MP forces the clock app to update the world time when the clock app is brought from the background or sleep.

To post a comment you must log in.
311. By Nekhelesh Ramananthan

improved comment

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
Riccardo Padovani (rpadovani) wrote :

Tested on mako, works as expected!
Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'clock/ClockPage.qml'
--- clock/ClockPage.qml 2014-01-29 12:09:13 +0000
+++ clock/ClockPage.qml 2014-01-29 21:18:22 +0000
@@ -78,6 +78,16 @@
78 currentUTCTime = now.getTime();78 currentUTCTime = now.getTime();
79 }79 }
8080
81 Connections {
82 target: root
83 onApplicationStateChanged: {
84 // Update world time immediately when the clock app is brought from suspend
85 // instead of waiting for the next minute to update.
86 if(root.applicationState)
87 updateTime()
88 }
89 }
90
81 GeoIPModel {91 GeoIPModel {
82 id: geoIP92 id: geoIP
83 onStatusChanged: {93 onStatusChanged: {
8494
=== modified file 'ubuntu-clock-app.qml'
--- ubuntu-clock-app.qml 2014-01-29 17:27:47 +0000
+++ ubuntu-clock-app.qml 2014-01-29 21:18:22 +0000
@@ -49,9 +49,14 @@
49 backgroundColor: "#A55263"49 backgroundColor: "#A55263"
50 footerColor: "#D75669"50 footerColor: "#D75669"
5151
52 // New properties of this page52 // Property to store the default application dimensions
53 readonly property real minimumWidth: units.gu(50)53 readonly property real minimumWidth: units.gu(50)
54 readonly property real minimumHeight: units.gu(75)54 readonly property real minimumHeight: units.gu(75)
55
56 // Property to store the state of an application (active or suspended)
57 property bool applicationState: Qt.application.active
58
59 // Property to store the current time
55 property var now60 property var now
5661
57 // Initialization after page has loaded62 // Initialization after page has loaded
@@ -228,4 +233,4 @@
228 }233 }
229 }234 }
230 }235 }
231}
232\ No newline at end of file236\ No newline at end of file
237}

Subscribers

People subscribed via source and target branches