MCPcopy Create free account
hub / github.com/MultiMC/Launcher / removeAccount

Method removeAccount

launcher/minecraft/auth/AccountList.cpp:127–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void 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
147MinecraftAccountPtr AccountList::defaultAccount() const
148{

Callers 1

Calls 3

QModelIndexClass · 0.85
isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected