MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / lessThan

Method lessThan

launcher/ui/instanceview/InstanceProxyModel.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool InstanceProxyModel::lessThan(const QModelIndex& left, const QModelIndex& right) const
43{
44 const QString leftCategory = left.data(InstanceViewRoles::GroupRole).toString();
45 const QString rightCategory = right.data(InstanceViewRoles::GroupRole).toString();
46 if (leftCategory == rightCategory) {
47 return subSortLessThan(left, right);
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
58bool InstanceProxyModel::subSortLessThan(const QModelIndex& left, const QModelIndex& right) const
59{

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected