mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
move resolution into update actions in task.
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -38,6 +38,7 @@
|
||||
#include <meta/VersionList.h>
|
||||
|
||||
#include <QSaveFile>
|
||||
#include <optional>
|
||||
|
||||
#include "Application.h"
|
||||
#include "FileSystem.h"
|
||||
@ -235,7 +236,8 @@ ProblemSeverity Component::getProblemSeverity() const
|
||||
{
|
||||
auto file = getVersionFile();
|
||||
if (file) {
|
||||
return file->getProblemSeverity();
|
||||
auto severity = file->getProblemSeverity();
|
||||
return m_componentProblemSeverity > severity ? m_componentProblemSeverity : severity;
|
||||
}
|
||||
return ProblemSeverity::Error;
|
||||
}
|
||||
@ -244,11 +246,27 @@ const QList<PatchProblem> Component::getProblems() const
|
||||
{
|
||||
auto file = getVersionFile();
|
||||
if (file) {
|
||||
return file->getProblems();
|
||||
auto problems = file->getProblems();
|
||||
problems.append(m_componentProblems);
|
||||
return problems;
|
||||
}
|
||||
return { { ProblemSeverity::Error, QObject::tr("Patch is not loaded yet.") } };
|
||||
}
|
||||
|
||||
void Component::addComponentProblem(ProblemSeverity severity, const QString& description)
|
||||
{
|
||||
if (severity > m_componentProblemSeverity) {
|
||||
m_componentProblemSeverity = severity;
|
||||
}
|
||||
m_componentProblems.append({ severity, description });
|
||||
}
|
||||
|
||||
void Component::resetComponentProblems()
|
||||
{
|
||||
m_componentProblems.clear();
|
||||
m_componentProblemSeverity = ProblemSeverity::None;
|
||||
}
|
||||
|
||||
void Component::setVersion(const QString& version)
|
||||
{
|
||||
if (version == m_version) {
|
||||
@ -415,6 +433,21 @@ void Component::waitLoadMeta()
|
||||
}
|
||||
}
|
||||
|
||||
void Component::setUpdateAction(UpdateAction action)
|
||||
{
|
||||
m_updateAction = action;
|
||||
}
|
||||
|
||||
std::optional<UpdateAction> Component::getUpdateAction()
|
||||
{
|
||||
return m_updateAction;
|
||||
}
|
||||
|
||||
void Component::clearUpdateAction()
|
||||
{
|
||||
m_updateAction.reset();
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug d, const Component& comp)
|
||||
{
|
||||
d << "Component(" << comp.m_uid << " : " << comp.m_cachedVersion << ")";
|
||||
|
Reference in New Issue
Block a user