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

Method getRecommended

launcher/VersionProxyModel.cpp:345–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345QModelIndex VersionProxyModel::getRecommended() const
346{
347 if (!roles.contains(BaseVersionList::RecommendedRole)) {
348 return index(0, 0);
349 }
350 int recommended = 0;
351 for (int i = 0; i < rowCount(); i++) {
352 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::RecommendedRole);
353 if (value.toBool()) {
354 recommended = i;
355 }
356 }
357 return index(recommended, 0);
358}
359
360QModelIndex VersionProxyModel::getVersion(const QString& version) const
361{

Callers

nothing calls this directly

Calls 2

containsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected