diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-02-21 01:44:27 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-02-21 01:44:27 +0100 |
commit | 1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae (patch) | |
tree | 2c2fbc7a74ea5035fdfd8752272e011852eb1b85 /logic/minecraft/MinecraftProfile.cpp | |
parent | 495d320ce267cf6d7c7e4468dbc36d3536bcb401 (diff) | |
download | MultiMC-1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae.tar MultiMC-1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae.tar.gz MultiMC-1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae.tar.lz MultiMC-1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae.tar.xz MultiMC-1a0bbdd9acaf1c5edaad6d3f0790c1b02674c0ae.zip |
GH-1453 report version file problems in the version page
Diffstat (limited to 'logic/minecraft/MinecraftProfile.cpp')
-rw-r--r-- | logic/minecraft/MinecraftProfile.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/logic/minecraft/MinecraftProfile.cpp b/logic/minecraft/MinecraftProfile.cpp index 4f33920b..360fa575 100644 --- a/logic/minecraft/MinecraftProfile.cpp +++ b/logic/minecraft/MinecraftProfile.cpp @@ -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 |