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

Method setData

launcher/minecraft/auth/AccountList.cpp:405–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405bool AccountList::setData(const QModelIndex& idx, const QVariant& value, int role)
406{
407 if (idx.row() < 0 || idx.row() >= rowCount(idx.parent()) || !idx.isValid()) {
408 return false;
409 }
410
411 if (role == Qt::CheckStateRole) {
412 if (value == Qt::Checked) {
413 MinecraftAccountPtr account = at(idx.row());
414 setDefaultAccount(account);
415 } else if (m_defaultAccount == at(idx.row()))
416 setDefaultAccount(nullptr);
417 }
418
419 emit dataChanged(idx, index(idx.row(), columnCount(QModelIndex()) - 1));
420 return true;
421}
422
423bool AccountList::loadList()
424{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
parentMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected