MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / subSortLessThan

Method subSortLessThan

launcher/ui/instanceview/InstanceProxyModel.cpp:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool InstanceProxyModel::subSortLessThan(const QModelIndex &left, const QModelIndex &right) const
59{
60 BaseInstance *pdataLeft = static_cast<BaseInstance *>(left.internalPointer());
61 BaseInstance *pdataRight = static_cast<BaseInstance *>(right.internalPointer());
62 QString sortMode = APPLICATION->settings()->get("InstSortMode").toString();
63 if (sortMode == "LastLaunch")
64 {
65 return pdataLeft->lastLaunch() > pdataRight->lastLaunch();
66 }
67 else
68 {
69 return m_naturalSort.compare(pdataLeft->name(), pdataRight->name()) < 0;
70 }
71}

Callers

nothing calls this directly

Calls 6

lastLaunchMethod · 0.80
toStringMethod · 0.45
getMethod · 0.45
settingsMethod · 0.45
compareMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected