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

Method performMainStartupAction

launcher/Application.cpp:1012–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1010}
1011
1012void Application::performMainStartupAction()
1013{
1014 m_status = Application::Initialized;
1015 if(!m_instanceIdToLaunch.isEmpty())
1016 {
1017 auto inst = instances()->getInstanceById(m_instanceIdToLaunch);
1018 if(inst)
1019 {
1020 MinecraftServerTargetPtr serverToJoin = nullptr;
1021 MinecraftAccountPtr accountToUse = nullptr;
1022
1023 qDebug() << "<> Instance" << m_instanceIdToLaunch << "launching";
1024 if(!m_serverToJoin.isEmpty())
1025 {
1026 // FIXME: validate the server string
1027 serverToJoin.reset(new MinecraftServerTarget(MinecraftServerTarget::parse(m_serverToJoin)));
1028 qDebug() << " Launching with server" << m_serverToJoin;
1029 }
1030
1031 if(!m_profileToUse.isEmpty())
1032 {
1033 accountToUse = accounts()->getAccountByProfileName(m_profileToUse);
1034 if(!accountToUse) {
1035 return;
1036 }
1037 qDebug() << " Launching with account" << m_profileToUse;
1038 }
1039
1040 launch(inst, true, nullptr, serverToJoin, accountToUse);
1041 return;
1042 }
1043 }
1044 if(!m_mainWindow)
1045 {
1046 // normal main window
1047 showMainWindow(false);
1048 qDebug() << "<> Main window shown.";
1049 }
1050 if(!m_zipToImport.isEmpty())
1051 {
1052 qDebug() << "<> Importing instance from zip:" << m_zipToImport;
1053 m_mainWindow->droppedURLs({ m_zipToImport });
1054 }
1055}
1056
1057void Application::showFatalErrorMessage(const QString& title, const QString& content)
1058{

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.80
getInstanceByIdMethod · 0.80
droppedURLsMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected