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

Method getRecommended

launcher/VersionProxyModel.cpp:397–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397QModelIndex VersionProxyModel::getRecommended() const
398{
399 if(!roles.contains(BaseVersionList::RecommendedRole))
400 {
401 return index(0, 0);
402 }
403 int recommended = 0;
404 for (int i = 0; i < rowCount(); i++)
405 {
406 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::RecommendedRole);
407 if (value.toBool())
408 {
409 recommended = i;
410 }
411 }
412 return index(recommended, 0);
413}
414
415QModelIndex VersionProxyModel::getVersion(const QString& version) const
416{

Callers

nothing calls this directly

Calls 2

containsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected