Merge lp:~vthompson/music-app/fix-sorting into lp:music-app/remix

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 751
Merged at revision: 749
Proposed branch: lp:~vthompson/music-app/fix-sorting
Merge into: lp:music-app/remix
Diff against target: 103 lines (+26/-13)
5 files modified
MusicAlbums.qml (+1/-0)
MusicArtists.qml (+11/-5)
MusicGenres.qml (+3/-6)
MusicTracks.qml (+1/-0)
music-app.qml (+10/-2)
To merge this branch: bzr merge lp:~vthompson/music-app/fix-sorting
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+242529@code.launchpad.net

Commit message

Use case insensitive sorting in SortFilterModel

Description of the change

This is a fix related to an SDK bug that was filed[1]. The SDK team has provided guidance on how to do case-insensitive sorting.

[1] https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1391034

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
Andrew Hayzen (ahayzen) wrote :

One inline comment, I also wonder if the allSongsModel and songsAlbumArtistModel should be sorted as well so that dispatcher and play all random are sorted in the same way. Note you'll need to change the id of the trackClicked calls to these if you do.

Furthermore in MusicGenres.qml we have...

AlbumsModel {
   id: albumGenreModel
   genre: model.genre
   store: musicStore
}

Repeater {
   id: albumGenreModelRepeater
   model: AlbumsModel {
       genre: model.genre
       store: musicStore
   }
...

Could you remove one of the AlbumsModel (either remove albumGenreModel or set the model of the repeater to albumGenreModel) as we have done in the other models. While we are playing about with models :)

review: Needs Fixing
lp:~vthompson/music-app/fix-sorting updated
749. By Victor Thompson

Remove custom getter from Artsts tab

750. By Victor Thompson

Remove unused model

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
lp:~vthompson/music-app/fix-sorting updated
751. By Victor Thompson

Wrap allSongsModel in SortFilterModel.

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
Andrew Hayzen (ahayzen) wrote :

Thanks for the changes LGTM :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MusicAlbums.qml'
--- MusicAlbums.qml 2014-11-01 23:25:42 +0000
+++ MusicAlbums.qml 2014-11-23 20:10:05 +0000
@@ -39,6 +39,7 @@
39 }39 }
40 sort.property: "title"40 sort.property: "title"
41 sort.order: Qt.AscendingOrder41 sort.order: Qt.AscendingOrder
42 sortCaseSensitivity: Qt.CaseInsensitive
42 }43 }
43 delegate: Card {44 delegate: Card {
44 id: albumCard45 id: albumCard
4546
=== modified file 'MusicArtists.qml'
--- MusicArtists.qml 2014-11-10 22:20:24 +0000
+++ MusicArtists.qml 2014-11-23 20:10:05 +0000
@@ -36,12 +36,18 @@
3636
37 CardView {37 CardView {
38 id: artistCardView38 id: artistCardView
39 getter: function (i) { return {"artist": artistsModel.get(i, ArtistsModel.RoleArtist)}; }
40 itemWidth: units.gu(12)39 itemWidth: units.gu(12)
41 model: ArtistsModel {40 model: SortFilterModel {
42 id: artistsModel41 id: artistsModelFilter
43 albumArtists: true42 property alias rowCount: artistsModel.rowCount
44 store: musicStore43 model: ArtistsModel {
44 id: artistsModel
45 albumArtists: true
46 store: musicStore
47 }
48 sort.property: "artist"
49 sort.order: Qt.AscendingOrder
50 sortCaseSensitivity: Qt.CaseInsensitive
45 }51 }
46 delegate: Card {52 delegate: Card {
47 id: artistCard53 id: artistCard
4854
=== modified file 'MusicGenres.qml'
--- MusicGenres.qml 2014-10-26 16:18:12 +0000
+++ MusicGenres.qml 2014-11-23 20:10:05 +0000
@@ -39,6 +39,9 @@
39 }39 }
40 filter.property: "genre"40 filter.property: "genre"
41 filter.pattern: /\S+/41 filter.pattern: /\S+/
42 sort.property: "genre"
43 sort.order: Qt.AscendingOrder
44 sortCaseSensitivity: Qt.CaseInsensitive
42 }45 }
4346
44 delegate: Card {47 delegate: Card {
@@ -50,12 +53,6 @@
5053
51 property string album: ""54 property string album: ""
5255
53 AlbumsModel {
54 id: albumGenreModel
55 genre: model.genre
56 store: musicStore
57 }
58
59 Repeater {56 Repeater {
60 id: albumGenreModelRepeater57 id: albumGenreModelRepeater
61 model: AlbumsModel {58 model: AlbumsModel {
6259
=== modified file 'MusicTracks.qml'
--- MusicTracks.qml 2014-10-28 02:05:16 +0000
+++ MusicTracks.qml 2014-11-23 20:10:05 +0000
@@ -117,6 +117,7 @@
117 }117 }
118 sort.property: "title"118 sort.property: "title"
119 sort.order: Qt.AscendingOrder119 sort.order: Qt.AscendingOrder
120 sortCaseSensitivity: Qt.CaseInsensitive
120 }121 }
121122
122 Component.onCompleted: {123 Component.onCompleted: {
123124
=== modified file 'music-app.qml'
--- music-app.qml 2014-11-15 23:12:50 +0000
+++ music-app.qml 2014-11-23 20:10:05 +0000
@@ -725,10 +725,18 @@
725 id: musicStore725 id: musicStore
726 }726 }
727727
728 SongsModel {728 SortFilterModel {
729 id: allSongsModel729 id: allSongsModel
730 objectName: "allSongsModel"730 objectName: "allSongsModel"
731 store: musicStore731 property alias rowCount: allSongsModelModel.rowCount
732 model: SongsModel {
733 id: allSongsModelModel
734 objectName: "allSongsModelModel"
735 store: musicStore
736 }
737 sort.property: "title"
738 sort.order: Qt.AscendingOrder
739 sortCaseSensitivity: Qt.CaseInsensitive
732 }740 }
733741
734 SongsModel {742 SongsModel {

Subscribers

People subscribed via source and target branches