MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / removeAccount

Method removeAccount

launcher/minecraft/auth/AccountList.cpp:154–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void 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
174MinecraftAccountPtr AccountList::defaultAccount() const
175{

Callers 1

Calls 3

QModelIndexClass · 0.85
isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected