Merge lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-australia-display-fix into lp:ubuntu-clock-app

Proposed by Bartosz Kosiorek
Status: Work in progress
Proposed branch: lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-australia-display-fix
Merge into: lp:ubuntu-clock-app
Diff against target: 78 lines (+29/-22)
2 files modified
app/components/DigitalMode.qml (+28/-22)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-australia-display-fix
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Needs Information
Nekhelesh Ramananthan Disapprove
Victor Thompson Needs Information
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+274183@code.launchpad.net

Commit message

Fix digital time display for English Australia locale (LP: #1384739)

Description of the change

Fix digital time display for English Australia locale (LP: #1384739)

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
Victor Thompson (vthompson) wrote :

2 inline comments.

review: Needs Information
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

As per the inline comments, I do think that this is a upstream QT issue IMO. I also commented about it in the bug report at https://bugs.launchpad.net/ubuntu-clock-app/+bug/1384739/comments/5. By patching it downstream in the clock app, I fear we might break other locales without proper testing.

Personally I don't like introducing downstream patches when the correct solution breaks in certain use-cases due to upstream bugs.

review: Disapprove
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Ok. I understand that it needs extensive testing.

Can we move this patch to the next Clock release then?

review: Needs Information
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> Ok. I understand that it needs extensive testing.
>
> Can we move this patch to the next Clock release then?

It would be better if the fix for this issue came from QtUbuntu [1] rather than patching it in the clock app. Downstream QT Patches are done in QtUbuntu (and upstream after a while). Can you talk to Timo Jyrinki who usually does this? You can find him in #ubuntu-app-devel, #ubuntu-touch etc under the nickname Mirv.

Let's not add these kind of patches in clock app due to upstream issues *unless* it is a High/Critical issue that affects a large portion of users. Instead we should convince upstream to fix these issues.

Testing is just one aspect of it. It just adds the headache of maintaining that patch ourselves once we add it.

[1] https://launchpad.net/qtubuntu

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

I have updated the bug report to reflect the decision and the way to move forward with this issue.

Unmerged revisions

398. By Bartosz Kosiorek

Fix digital time display for English Australia locale (LP: #1384739)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/DigitalMode.qml'
2--- app/components/DigitalMode.qml 2015-09-16 15:13:36 +0000
3+++ app/components/DigitalMode.qml 2015-10-12 20:43:31 +0000
4@@ -56,17 +56,20 @@
5 color: UbuntuColors.midAubergine
6 font.pixelSize: units.dp(1)
7 text: {
8- if (localizedTimeString.search(Qt.locale().amText) !== -1) {
9- // 12 hour format detected with the localised AM text
10- return localizedTimeString.replace(Qt.locale().amText, "").trim()
11- }
12- else if (localizedTimeString.search(Qt.locale().pmText) !== -1) {
13- // 12 hour format detected with the localised PM text
14- return localizedTimeString.replace(Qt.locale().pmText, "").trim()
15- }
16- else {
17- // 24-hour format detected, return full time string
18- return localizedTimeString
19+ // Fix for lp:1384739
20+ if (localizedTimeString.split(" ").length > 1) {
21+ localizedTimeString.split(" ")[0]
22+ } else {
23+ if (localizedTimeString.search(Qt.locale().amText) !== -1) {
24+ // 12 hour format detected with the localised AM text
25+ return localizedTimeString.replace(Qt.locale().amText, "").trim()
26+ } else if (localizedTimeString.search(Qt.locale().pmText) !== -1) {
27+ // 12 hour format detected with the localised PM text
28+ return localizedTimeString.replace(Qt.locale().pmText, "").trim()
29+ } else {
30+ // 24-hour format detected, return full time string
31+ return localizedTimeString
32+ }
33 }
34 }
35 }
36@@ -81,17 +84,20 @@
37 font.pixelSize: units.dp(1)
38 visible: text !== ""
39 text: {
40- if (localizedTimeString.search(Qt.locale().amText) !== -1) {
41- // 12 hour format detected with the localised AM text
42- return Qt.locale().amText
43- }
44- else if (localizedTimeString.search(Qt.locale().pmText) !== -1) {
45- // 12 hour format detected with the localised PM text
46- return Qt.locale().pmText
47- }
48- else {
49- // 24-hour format detected
50- return ""
51+ // Fix for lp:1384739
52+ if (localizedTimeString.split(" ").length > 1) {
53+ localizedTimeString.split(" ")[1]
54+ } else {
55+ if (localizedTimeString.search(Qt.locale().amText) !== -1) {
56+ // 12 hour format detected with the localised AM text
57+ return Qt.locale().amText
58+ } else if (localizedTimeString.search(Qt.locale().pmText) !== -1) {
59+ // 12 hour format detected with the localised PM text
60+ return Qt.locale().pmText
61+ } else {
62+ // 24-hour format detected
63+ return ""
64+ }
65 }
66 }
67 }
68
69=== modified file 'debian/changelog'
70--- debian/changelog 2015-09-17 04:33:11 +0000
71+++ debian/changelog 2015-10-12 20:43:31 +0000
72@@ -16,6 +16,7 @@
73 * Fix stopwatch issue appering during changing timezone during runtime (LP: #1493358)
74 * Fix Daylight Saving Time issues (LP: #1437805)
75 * Fix time for second location wrong after daylight saving started (LP: #1457523)
76+ * Fix digital time display for English Australia locale (LP: #1384739)
77
78 -- Bartosz Kosiorek <gang65@poczta.onet.pl> Wed, 02 Sep 2015 15:16:29 +0200
79

Subscribers

People subscribed via source and target branches