| 152 | } |
| 153 | |
| 154 | void AccountList::removeAccount(QModelIndex index) |
| 155 | { |
| 156 | int row = index.row(); |
| 157 | if(index.isValid() && row >= 0 && row < m_accounts.size()) |
| 158 | { |
| 159 | auto & account = m_accounts[row]; |
| 160 | if(account == m_defaultAccount) |
| 161 | { |
| 162 | m_defaultAccount = nullptr; |
| 163 | onDefaultAccountChanged(); |
| 164 | } |
| 165 | account->disconnect(this); |
| 166 | |
| 167 | beginRemoveRows(QModelIndex(), row, row); |
| 168 | m_accounts.removeAt(index.row()); |
| 169 | endRemoveRows(); |
| 170 | onListChanged(); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | MinecraftAccountPtr AccountList::defaultAccount() const |
| 175 | { |
no test coverage detected