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

Method createSetupWizard

launcher/Application.cpp:994–1057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994bool Application::createSetupWizard()
995{
996 bool javaRequired = [&]()
997 {
998 QString currentHostName = QHostInfo::localHostName();
999 QString oldHostName = settings()->get("LastHostname").toString();
1000 if (currentHostName != oldHostName)
1001 {
1002 settings()->set("LastHostname", currentHostName);
1003 return true;
1004 }
1005 QString currentJavaPath = settings()->get("JavaPath").toString();
1006 QString actualPath = FS::ResolveExecutable(currentJavaPath);
1007 if (actualPath.isNull())
1008 {
1009 return true;
1010 }
1011 return false;
1012 }();
1013 bool analyticsRequired = [&]()
1014 {
1015 if(BuildConfig.ANALYTICS_ID.isEmpty())
1016 {
1017 return false;
1018 }
1019 if (!settings()->get("Analytics").toBool())
1020 {
1021 return false;
1022 }
1023 if (settings()->get("AnalyticsSeen").toInt() < analytics()->version())
1024 {
1025 return true;
1026 }
1027 return false;
1028 }();
1029 bool languageRequired = [&]()
1030 {
1031 if (settings()->get("Language").toString().isEmpty())
1032 return true;
1033 return false;
1034 }();
1035 bool wizardRequired = javaRequired || analyticsRequired || languageRequired;
1036
1037 if(wizardRequired)
1038 {
1039 m_setupWizard = new SetupWizard(nullptr);
1040 if (languageRequired)
1041 {
1042 m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
1043 }
1044 if (javaRequired)
1045 {
1046 m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
1047 }
1048 if(analyticsRequired)
1049 {
1050 m_setupWizard->addPage(new AnalyticsWizardPage(m_setupWizard));
1051 }

Callers

nothing calls this directly

Calls 7

ResolveExecutableFunction · 0.85
isEmptyMethod · 0.80
addPageMethod · 0.80
toStringMethod · 0.45
getMethod · 0.45
setMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected