| 1195 | } |
| 1196 | |
| 1197 | std::vector<ModInfo::EFlag> ModListView::modFlags(const QModelIndex& index, |
| 1198 | bool* forceCompact) const |
| 1199 | { |
| 1200 | ModInfo::Ptr info = ModInfo::getByIndex(index.data(ModList::IndexRole).toInt()); |
| 1201 | |
| 1202 | auto flags = info->getFlags(); |
| 1203 | bool compact = false; |
| 1204 | if (info->isSeparator() && hasCollapsibleSeparators() && |
| 1205 | m_core->settings().interface().collapsibleSeparatorsIcons(ModList::COL_FLAGS) && |
| 1206 | !isExpanded(index.sibling(index.row(), 0))) { |
| 1207 | |
| 1208 | // combine the child conflicts |
| 1209 | std::set eFlags(flags.begin(), flags.end()); |
| 1210 | for (int i = 0; i < model()->rowCount(index); ++i) { |
| 1211 | auto cIndex = |
| 1212 | model()->index(i, index.column(), index).data(ModList::IndexRole).toInt(); |
| 1213 | auto cFlags = ModInfo::getByIndex(cIndex)->getFlags(); |
| 1214 | eFlags.insert(cFlags.begin(), cFlags.end()); |
| 1215 | } |
| 1216 | flags = {eFlags.begin(), eFlags.end()}; |
| 1217 | |
| 1218 | // force compact because there can be a lots of flags here |
| 1219 | compact = true; |
| 1220 | } |
| 1221 | |
| 1222 | if (forceCompact) { |
| 1223 | *forceCompact = true; |
| 1224 | } |
| 1225 | |
| 1226 | return flags; |
| 1227 | } |
| 1228 | |
| 1229 | std::vector<ModInfo::EConflictFlag> ModListView::conflictFlags(const QModelIndex& index, |
| 1230 | bool* forceCompact) const |