MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / changeActiveAccount

Method changeActiveAccount

launcher/ui/MainWindow.cpp:704–721  ·  view source on GitHub ↗

* Assumes the sender is a QAction */

Source from the content-addressed store, hash-verified

702 * Assumes the sender is a QAction
703 */
704void MainWindow::changeActiveAccount()
705{
706 QAction* sAction = (QAction*)sender();
707
708 // Profile's associated Mojang username
709 if (sAction->data().type() != QVariant::Type::Int)
710 return;
711
712 QVariant action_data = sAction->data();
713 bool valid = false;
714 int index = action_data.toInt(&valid);
715 if (!valid) {
716 index = -1;
717 }
718 auto accounts = APPLICATION->accounts();
719 accounts->setDefaultAccount(index == -1 ? nullptr : accounts->at(index));
720 defaultAccountChanged();
721}
722
723void MainWindow::defaultAccountChanged()
724{

Callers

nothing calls this directly

Calls 5

accountsMethod · 0.80
setDefaultAccountMethod · 0.80
typeMethod · 0.45
dataMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected