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

Method packageCurrent

launcher/ui/pages/instance/VersionPage.cpp:160–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160void VersionPage::packageCurrent(const QModelIndex &current, const QModelIndex &previous)
161{
162 if (!current.isValid())
163 {
164 ui->frame->clear();
165 return;
166 }
167 int row = current.row();
168 auto patch = m_profile->getComponent(row);
169 auto severity = patch->getProblemSeverity();
170 switch(severity)
171 {
172 case ProblemSeverity::Warning:
173 ui->frame->setModText(tr("%1 possibly has issues.").arg(patch->getName()));
174 break;
175 case ProblemSeverity::Error:
176 ui->frame->setModText(tr("%1 has issues!").arg(patch->getName()));
177 break;
178 default:
179 case ProblemSeverity::None:
180 ui->frame->clear();
181 return;
182 }
183
184 auto &problems = patch->getProblems();
185 QString problemOut;
186 for (auto &problem: problems)
187 {
188 if(problem.m_severity == ProblemSeverity::Error)
189 {
190 problemOut += tr("Error: ");
191 }
192 else if(problem.m_severity == ProblemSeverity::Warning)
193 {
194 problemOut += tr("Warning: ");
195 }
196 problemOut += problem.m_description;
197 problemOut += "\n";
198 }
199 ui->frame->setModDescription(problemOut);
200}
201
202void VersionPage::updateRunningStatus(bool running)
203{

Callers

nothing calls this directly

Calls 8

getComponentMethod · 0.80
setModTextMethod · 0.80
getNameMethod · 0.80
setModDescriptionMethod · 0.80
isValidMethod · 0.45
clearMethod · 0.45
getProblemSeverityMethod · 0.45
getProblemsMethod · 0.45

Tested by

no test coverage detected