Merge lp:~nik90/ubuntu-clock-app/default-alarm-sound-backwards-compatibility into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Bartosz Kosiorek
Approved revision: 346
Merged at revision: 346
Proposed branch: lp:~nik90/ubuntu-clock-app/default-alarm-sound-backwards-compatibility
Merge into: lp:ubuntu-clock-app
Diff against target: 48 lines (+25/-4)
1 file modified
app/alarm/EditAlarmPage.qml (+25/-4)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/default-alarm-sound-backwards-compatibility
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+268808@code.launchpad.net

Commit message

Maintain backwards compatible with users on OTA-5 users w.r.t to the default alarm sound.

Description of the change

Clock App v3.5 will be released *before* OTA-6. However Clock App also switched to "Alarm clock" as its default alarm sound which only landed in OTA-6. This MP helps maintain backwards compatibility with OTA-5 users. It is a small harmless patch.

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
Bartosz Kosiorek (gang65) wrote :

It looks ok to me.

According to checklist you don't need to do anything with that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/EditAlarmPage.qml'
2--- app/alarm/EditAlarmPage.qml 2015-08-21 14:41:20 +0000
3+++ app/alarm/EditAlarmPage.qml 2015-08-21 21:31:28 +0000
4@@ -155,10 +155,28 @@
5 }
6 }
7
8+ /*
9+ #TODO: The default alarm sound was changed to "Alarm clock" which only lands
10+ in OTA-6. This function is need to maintain backwards compatibility with
11+ OTA-5 users.
12+ */
13+ function fallbacktoOldDefaultAlarmSound() {
14+ _alarm.sound = getSoundPath("Suru arpeggio")
15+ _alarmSound.subText = "Suru arpeggio"
16+ }
17+
18+ function setDefaultAlarmSound() {
19+ _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)
20+ _alarmSound.subText = _alarmSound.defaultAlarmSound
21+ }
22+
23 function setAlarmSound() {
24 if(isNewAlarm) {
25- _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)
26- _alarmSound.subText = _alarmSound.defaultAlarmSound
27+ if (!getSoundPath(_alarmSound.defaultAlarmSound)) {
28+ fallbacktoOldDefaultAlarmSound()
29+ } else {
30+ setDefaultAlarmSound()
31+ }
32 }
33 else {
34 _alarmSound.subText = getSoundName(_alarm.sound.toString())
35@@ -168,8 +186,11 @@
36 empty string.
37 */
38 if (_alarmSound.subText === "") {
39- _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)
40- _alarmSound.subText = _alarmSound.defaultAlarmSound
41+ if (!getSoundPath(_alarmSound.defaultAlarmSound)) {
42+ fallbacktoOldDefaultAlarmSound()
43+ } else {
44+ setDefaultAlarmSound()
45+ }
46 }
47 }
48 }

Subscribers

People subscribed via source and target branches