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

Method getVersion

launcher/VersionProxyModel.cpp:371–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371QModelIndex VersionProxyModel::getVersion(const QString& version) const
372{
373 int found = -1;
374 for (int i = 0; i < rowCount(); i++) {
375 auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::VersionRole);
376 if (value.toString() == version) {
377 found = i;
378 }
379 }
380 if (found == -1) {
381 return QModelIndex();
382 }
383 return index(found, 0);
384}
385
386void VersionProxyModel::clearFilters()
387{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
dataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected