MCPcopy Create free account
hub / github.com/MultiMC/Launcher / getRecommended

Method getRecommended

launcher/VersionProxyModel.cpp:359–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359QModelIndex VersionProxyModel::getRecommended() const
360{
361 if(!roles.contains(BaseVersionList::RecommendedRole))
362 {
363 return index(0, 0);
364 }
365 int recommended = 0;
366 for (int i = 0; i < rowCount(); i++)
367 {
368 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::RecommendedRole);
369 if (value.toBool())
370 {
371 recommended = i;
372 }
373 }
374 return index(recommended, 0);
375}
376
377QModelIndex VersionProxyModel::getVersion(const QString& version) const
378{

Callers

nothing calls this directly

Calls 2

containsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected