MCPcopy Create free account
hub / github.com/KDE/kdevelop / lessThan

Method lessThan

kdevplatform/vcs/models/vcsfilechangesmodel.cpp:74–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74bool VcsFileChangesSortProxyModel::lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const
75{
76 const auto leftStatus = source_left.data(VcsFileChangesModel::StateRole).value<VcsStatusInfo::State>();
77 const auto rightStatus = source_right.data(VcsFileChangesModel::StateRole).value<VcsStatusInfo::State>();
78 if (leftStatus != rightStatus) {
79 return leftStatus < rightStatus;
80 }
81
82 const QString leftPath = source_left.data(VcsFileChangesModel::UrlRole).toString();
83 const QString rightPath = source_right.data(VcsFileChangesModel::UrlRole).toString();
84 return QString::localeAwareCompare(leftPath, rightPath) < 0;
85}
86
87class VcsStatusInfoItem : public QStandardItem
88{

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected