mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-22 11:39:55 +00:00
GH-1453 report version file problems in the version page
This commit is contained in:
@@ -295,6 +295,8 @@ QVariant MinecraftProfile::data(const QModelIndex &index, int role) const
|
||||
if (row < 0 || row >= VersionPatches.size())
|
||||
return QVariant();
|
||||
|
||||
auto patch = VersionPatches.at(row);
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
switch (column)
|
||||
@@ -303,7 +305,6 @@ QVariant MinecraftProfile::data(const QModelIndex &index, int role) const
|
||||
return VersionPatches.at(row)->getPatchName();
|
||||
case 1:
|
||||
{
|
||||
auto patch = VersionPatches.at(row);
|
||||
if(patch->isCustom())
|
||||
{
|
||||
return QString("%1 (Custom)").arg(patch->getPatchVersion());
|
||||
@@ -317,6 +318,29 @@ QVariant MinecraftProfile::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
if(role == Qt::DecorationRole)
|
||||
{
|
||||
switch(column)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
auto severity = patch->getProblemSeverity();
|
||||
switch (severity)
|
||||
{
|
||||
case PROBLEM_WARNING:
|
||||
return "warning";
|
||||
case PROBLEM_ERROR:
|
||||
return "error";
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
QVariant MinecraftProfile::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
|
||||
Reference in New Issue
Block a user