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

Method getVersion

launcher/VersionProxyModel.cpp:360–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360QModelIndex VersionProxyModel::getVersion(const QString& version) const
361{
362 int found = -1;
363 for (int i = 0; i < rowCount(); i++) {
364 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::VersionRole);
365 if (value.toString() == version) {
366 found = i;
367 }
368 }
369 if (found == -1) {
370 return QModelIndex();
371 }
372 return index(found, 0);
373}
374
375void VersionProxyModel::clearFilters()
376{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
dataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected