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
=== modified file 'app/alarm/EditAlarmPage.qml'
--- app/alarm/EditAlarmPage.qml 2015-08-21 14:41:20 +0000
+++ app/alarm/EditAlarmPage.qml 2015-08-21 21:31:28 +0000
@@ -155,10 +155,28 @@
155 }155 }
156 }156 }
157157
158 /*
159 #TODO: The default alarm sound was changed to "Alarm clock" which only lands
160 in OTA-6. This function is need to maintain backwards compatibility with
161 OTA-5 users.
162 */
163 function fallbacktoOldDefaultAlarmSound() {
164 _alarm.sound = getSoundPath("Suru arpeggio")
165 _alarmSound.subText = "Suru arpeggio"
166 }
167
168 function setDefaultAlarmSound() {
169 _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)
170 _alarmSound.subText = _alarmSound.defaultAlarmSound
171 }
172
158 function setAlarmSound() {173 function setAlarmSound() {
159 if(isNewAlarm) {174 if(isNewAlarm) {
160 _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)175 if (!getSoundPath(_alarmSound.defaultAlarmSound)) {
161 _alarmSound.subText = _alarmSound.defaultAlarmSound176 fallbacktoOldDefaultAlarmSound()
177 } else {
178 setDefaultAlarmSound()
179 }
162 }180 }
163 else {181 else {
164 _alarmSound.subText = getSoundName(_alarm.sound.toString())182 _alarmSound.subText = getSoundName(_alarm.sound.toString())
@@ -168,8 +186,11 @@
168 empty string.186 empty string.
169 */187 */
170 if (_alarmSound.subText === "") {188 if (_alarmSound.subText === "") {
171 _alarm.sound = getSoundPath(_alarmSound.defaultAlarmSound)189 if (!getSoundPath(_alarmSound.defaultAlarmSound)) {
172 _alarmSound.subText = _alarmSound.defaultAlarmSound190 fallbacktoOldDefaultAlarmSound()
191 } else {
192 setDefaultAlarmSound()
193 }
173 }194 }
174 }195 }
175 }196 }

Subscribers

People subscribed via source and target branches