Code review comment for lp:~nik90/ubuntu-clock-app/edit-alarm-feature

Revision history for this message
Victor Thompson (vthompson) wrote :

In terms of reacting to when the ringtones folder doesn't exist, perhaps you could do the following:

bzr diff
=== modified file 'app/alarm/AlarmSound.qml'
--- app/alarm/AlarmSound.qml 2014-06-24 20:15:38 +0000
+++ app/alarm/AlarmSound.qml 2014-07-07 04:02:07 +0000
@@ -31,6 +31,8 @@

     FolderListModel {
         id: _soundModel
+ showDirs: false
+ nameFilters: [ "*.ogg", "*.mp3" ]
         folder: "/usr/share/sounds/ubuntu/ringtones"
     }

This would 1) prevent directories from being shown in the model, and 2) filter the files allowable to just mp3 and ogg. I think you should do #1 because a directory can never be selected. I think it would be a good idea to do #2 as an additional safe guard, but one could argue that it would add extra maintenance work if the ringtones include additional filetypes in the future. As of right now they are all ogg files.

« Back to merge proposal