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

Method preselect

launcher/ui/pages/instance/VersionPage.cpp:564–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564void VersionPage::preselect(int row)
565{
566 if(row < 0)
567 {
568 row = 0;
569 }
570 if(row >= m_profile->rowCount(QModelIndex()))
571 {
572 row = m_profile->rowCount(QModelIndex()) - 1;
573 }
574 if(row < 0)
575 {
576 return;
577 }
578 auto model_index = m_profile->index(row);
579 ui->packageView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
580 updateButtons(row);
581}
582
583void VersionPage::onGameUpdateError(QString error)
584{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
rowCountMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected