| 403 | } |
| 404 | |
| 405 | bool 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 | |
| 423 | bool AccountList::loadList() |
| 424 | { |
nothing calls this directly
no test coverage detected