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
1=== modified file 'clock/ClockPage.qml'
2--- clock/ClockPage.qml 2014-01-29 12:09:13 +0000
3+++ clock/ClockPage.qml 2014-01-29 21:18:22 +0000
4@@ -78,6 +78,16 @@
5 currentUTCTime = now.getTime();
6 }
7
8+ Connections {
9+ target: root
10+ onApplicationStateChanged: {
11+ // Update world time immediately when the clock app is brought from suspend
12+ // instead of waiting for the next minute to update.
13+ if(root.applicationState)
14+ updateTime()
15+ }
16+ }
17+
18 GeoIPModel {
19 id: geoIP
20 onStatusChanged: {
21
22=== modified file 'ubuntu-clock-app.qml'
23--- ubuntu-clock-app.qml 2014-01-29 17:27:47 +0000
24+++ ubuntu-clock-app.qml 2014-01-29 21:18:22 +0000
25@@ -49,9 +49,14 @@
26 backgroundColor: "#A55263"
27 footerColor: "#D75669"
28
29- // New properties of this page
30+ // Property to store the default application dimensions
31 readonly property real minimumWidth: units.gu(50)
32 readonly property real minimumHeight: units.gu(75)
33+
34+ // Property to store the state of an application (active or suspended)
35+ property bool applicationState: Qt.application.active
36+
37+ // Property to store the current time
38 property var now
39
40 // Initialization after page has loaded
41@@ -228,4 +233,4 @@
42 }
43 }
44 }
45-}
46\ No newline at end of file
47+}

Subscribers

People subscribed via source and target branches