← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1495482] [NEW] SortFilterModel cannot sort by a numeric role

 

Public bug reported:

I’d like to replace a custom model in webbrowser-app with SortFilterModel (my model does both sorting and filtering), but at the moment I can’t because SortFilterModel does its sort on string comparisons, and the role I want to compare on is an integer.
10 > 2, but "2" > "10".
Ideally, SortFilterModel would detect the type of the role, and apply the appropriate comparison, instead of casting everything to a string.

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1495482

Title:
  SortFilterModel cannot sort by a numeric role

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  I’d like to replace a custom model in webbrowser-app with SortFilterModel (my model does both sorting and filtering), but at the moment I can’t because SortFilterModel does its sort on string comparisons, and the role I want to compare on is an integer.
  10 > 2, but "2" > "10".
  Ideally, SortFilterModel would detect the type of the role, and apply the appropriate comparison, instead of casting everything to a string.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1495482/+subscriptions


Follow ups