MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / getRecommended

Method getRecommended

launcher/VersionProxyModel.cpp:356–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

containsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected