| 40 | } |
| 41 | |
| 42 | bool InstanceProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { |
| 43 | const QString leftCategory = left.data(InstanceViewRoles::GroupRole).toString(); |
| 44 | const QString rightCategory = right.data(InstanceViewRoles::GroupRole).toString(); |
| 45 | if (leftCategory == rightCategory) { |
| 46 | return subSortLessThan(left, right); |
| 47 | } |
| 48 | else { |
| 49 | // FIXME: real group sorting happens in InstanceView::updateGeometries(), see LocaleString |
| 50 | auto result = leftCategory.localeAwareCompare(rightCategory); |
| 51 | if(result == 0) { |
| 52 | return subSortLessThan(left, right); |
| 53 | } |
| 54 | return result < 0; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | bool InstanceProxyModel::subSortLessThan(const QModelIndex &left, const QModelIndex &right) const |
| 59 | { |