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

Method packageCurrent

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

Source from the content-addressed store, hash-verified

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

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