GH-1453 report version file problems in the version page

This commit is contained in:
Petr Mrázek 2016-02-21 01:44:27 +01:00
parent 495d320ce2
commit 1a0bbdd9ac
11 changed files with 305 additions and 26 deletions

View file

@ -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