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
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2014-11-01 23:25:42 +0000
3+++ MusicAlbums.qml 2014-11-23 20:10:05 +0000
4@@ -39,6 +39,7 @@
5 }
6 sort.property: "title"
7 sort.order: Qt.AscendingOrder
8+ sortCaseSensitivity: Qt.CaseInsensitive
9 }
10 delegate: Card {
11 id: albumCard
12
13=== modified file 'MusicArtists.qml'
14--- MusicArtists.qml 2014-11-10 22:20:24 +0000
15+++ MusicArtists.qml 2014-11-23 20:10:05 +0000
16@@ -36,12 +36,18 @@
17
18 CardView {
19 id: artistCardView
20- getter: function (i) { return {"artist": artistsModel.get(i, ArtistsModel.RoleArtist)}; }
21 itemWidth: units.gu(12)
22- model: ArtistsModel {
23- id: artistsModel
24- albumArtists: true
25- store: musicStore
26+ model: SortFilterModel {
27+ id: artistsModelFilter
28+ property alias rowCount: artistsModel.rowCount
29+ model: ArtistsModel {
30+ id: artistsModel
31+ albumArtists: true
32+ store: musicStore
33+ }
34+ sort.property: "artist"
35+ sort.order: Qt.AscendingOrder
36+ sortCaseSensitivity: Qt.CaseInsensitive
37 }
38 delegate: Card {
39 id: artistCard
40
41=== modified file 'MusicGenres.qml'
42--- MusicGenres.qml 2014-10-26 16:18:12 +0000
43+++ MusicGenres.qml 2014-11-23 20:10:05 +0000
44@@ -39,6 +39,9 @@
45 }
46 filter.property: "genre"
47 filter.pattern: /\S+/
48+ sort.property: "genre"
49+ sort.order: Qt.AscendingOrder
50+ sortCaseSensitivity: Qt.CaseInsensitive
51 }
52
53 delegate: Card {
54@@ -50,12 +53,6 @@
55
56 property string album: ""
57
58- AlbumsModel {
59- id: albumGenreModel
60- genre: model.genre
61- store: musicStore
62- }
63-
64 Repeater {
65 id: albumGenreModelRepeater
66 model: AlbumsModel {
67
68=== modified file 'MusicTracks.qml'
69--- MusicTracks.qml 2014-10-28 02:05:16 +0000
70+++ MusicTracks.qml 2014-11-23 20:10:05 +0000
71@@ -117,6 +117,7 @@
72 }
73 sort.property: "title"
74 sort.order: Qt.AscendingOrder
75+ sortCaseSensitivity: Qt.CaseInsensitive
76 }
77
78 Component.onCompleted: {
79
80=== modified file 'music-app.qml'
81--- music-app.qml 2014-11-15 23:12:50 +0000
82+++ music-app.qml 2014-11-23 20:10:05 +0000
83@@ -725,10 +725,18 @@
84 id: musicStore
85 }
86
87- SongsModel {
88+ SortFilterModel {
89 id: allSongsModel
90 objectName: "allSongsModel"
91- store: musicStore
92+ property alias rowCount: allSongsModelModel.rowCount
93+ model: SongsModel {
94+ id: allSongsModelModel
95+ objectName: "allSongsModelModel"
96+ store: musicStore
97+ }
98+ sort.property: "title"
99+ sort.order: Qt.AscendingOrder
100+ sortCaseSensitivity: Qt.CaseInsensitive
101 }
102
103 SongsModel {

Subscribers

People subscribed via source and target branches