Merge lp:~osomon/ubuntu-ui-toolkit/fix-SortFilterModel-1485674-staging into lp:ubuntu-ui-toolkit/staging

Proposed by Olivier Tilloy
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1614
Merged at revision: 1614
Proposed branch: lp:~osomon/ubuntu-ui-toolkit/fix-SortFilterModel-1485674-staging
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 18 lines (+6/-3)
1 file modified
src/Ubuntu/Components/plugin/sortfiltermodel.cpp (+6/-3)
To merge this branch: bzr merge lp:~osomon/ubuntu-ui-toolkit/fix-SortFilterModel-1485674-staging
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+268627@code.launchpad.net

Commit message

Take custom key indexes into account to allow sorting on custom roles.

To post a comment you must log in.
Revision history for this message
Zsombor Egri (zsombi) wrote :

It was reviewed before, approving.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/Components/plugin/sortfiltermodel.cpp'
--- src/Ubuntu/Components/plugin/sortfiltermodel.cpp 2015-03-03 13:47:48 +0000
+++ src/Ubuntu/Components/plugin/sortfiltermodel.cpp 2015-08-20 17:10:36 +0000
@@ -113,9 +113,12 @@
113QSortFilterProxyModelQML::roleByName(const QString& roleName) const113QSortFilterProxyModelQML::roleByName(const QString& roleName) const
114{114{
115 const QHash<int, QByteArray> roles = roleNames();115 const QHash<int, QByteArray> roles = roleNames();
116 for(int role = 0; role < roles.count(); role++)116 QHashIterator<int, QByteArray> i(roles);
117 if (roles[role] == roleName)117 while (i.hasNext()) {
118 return role;118 i.next();
119 if (i.value() == roleName)
120 return i.key();
121 }
119 return 0;122 return 0;
120}123}
121124

Subscribers

People subscribed via source and target branches