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

Method packageCurrent

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

Source from the content-addressed store, hash-verified

192}
193
194void VersionPage::packageCurrent(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
195{
196 if (!current.isValid()) {
197 ui->frame->clear();
198 return;
199 }
200 int row = current.row();
201 auto patch = m_profile->getComponent(row);
202 auto severity = patch->getProblemSeverity();
203 switch (severity) {
204 case ProblemSeverity::Warning:
205 ui->frame->setName(tr("%1 possibly has issues.").arg(patch->getName()));
206 break;
207 case ProblemSeverity::Error:
208 ui->frame->setName(tr("%1 has issues!").arg(patch->getName()));
209 break;
210 default:
211 case ProblemSeverity::None:
212 ui->frame->clear();
213 return;
214 }
215
216 auto& problems = patch->getProblems();
217 QString problemOut;
218 for (auto& problem : problems) {
219 if (problem.m_severity == ProblemSeverity::Error) {
220 problemOut += tr("Error: ");
221 } else if (problem.m_severity == ProblemSeverity::Warning) {
222 problemOut += tr("Warning: ");
223 }
224 problemOut += problem.m_description;
225 problemOut += "\n";
226 }
227 ui->frame->setDescription(problemOut);
228}
229
230void VersionPage::updateVersionControls()
231{

Callers

nothing calls this directly

Calls 8

getComponentMethod · 0.80
getNameMethod · 0.80
isValidMethod · 0.45
clearMethod · 0.45
getProblemSeverityMethod · 0.45
setNameMethod · 0.45
getProblemsMethod · 0.45
setDescriptionMethod · 0.45

Tested by

no test coverage detected