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

Method getVersion

launcher/VersionProxyModel.cpp:415–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415QModelIndex VersionProxyModel::getVersion(const QString& version) const
416{
417 int found = -1;
418 for (int i = 0; i < rowCount(); i++)
419 {
420 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::VersionRole);
421 if (value.toString() == version)
422 {
423 found = i;
424 }
425 }
426 if(found == -1)
427 {
428 return QModelIndex();
429 }
430 return index(found, 0);
431}
432
433void VersionProxyModel::clearFilters()
434{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
dataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected