| 125 | } |
| 126 | |
| 127 | void AccountList::removeAccount(QModelIndex index) |
| 128 | { |
| 129 | int row = index.row(); |
| 130 | if(index.isValid() && row >= 0 && row < m_accounts.size()) |
| 131 | { |
| 132 | auto & account = m_accounts[row]; |
| 133 | if(account == m_defaultAccount) |
| 134 | { |
| 135 | m_defaultAccount = nullptr; |
| 136 | onDefaultAccountChanged(); |
| 137 | } |
| 138 | account->disconnect(this); |
| 139 | |
| 140 | beginRemoveRows(QModelIndex(), row, row); |
| 141 | m_accounts.removeAt(index.row()); |
| 142 | endRemoveRows(); |
| 143 | onListChanged(); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | MinecraftAccountPtr AccountList::defaultAccount() const |
| 148 | { |
no test coverage detected