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

Method getVersion

launcher/VersionProxyModel.cpp:377–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377QModelIndex VersionProxyModel::getVersion(const QString& version) const
378{
379 int found = -1;
380 for (int i = 0; i < rowCount(); i++)
381 {
382 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::VersionRole);
383 if (value.toString() == version)
384 {
385 found = i;
386 }
387 }
388 if(found == -1)
389 {
390 return QModelIndex();
391 }
392 return index(found, 0);
393}
394
395void VersionProxyModel::clearFilters()
396{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
dataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected