| 56 | } |
| 57 | |
| 58 | void InfoFrame::updateWithMod(Mod const& m) |
| 59 | { |
| 60 | if (m.type() == ResourceType::FOLDER) |
| 61 | { |
| 62 | clear(); |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | QString text = ""; |
| 67 | QString name = ""; |
| 68 | if (m.name().isEmpty()) |
| 69 | name = m.internal_id(); |
| 70 | else |
| 71 | name = m.name(); |
| 72 | |
| 73 | if (m.homeurl().isEmpty()) |
| 74 | text = name; |
| 75 | else |
| 76 | text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>"; |
| 77 | if (!m.authors().isEmpty()) |
| 78 | text += " by " + m.authors().join(", "); |
| 79 | |
| 80 | setName(text); |
| 81 | |
| 82 | if (m.description().isEmpty()) |
| 83 | { |
| 84 | setDescription(QString()); |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | setDescription(m.description()); |
| 89 | } |
| 90 | |
| 91 | setImage(); |
| 92 | } |
| 93 | |
| 94 | void InfoFrame::updateWithResource(const Resource& resource) |
| 95 | { |
no test coverage detected