MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / modFlags

Method modFlags

src/modlistview.cpp:1197–1227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197std::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
1229std::vector<ModInfo::EConflictFlag> ModListView::conflictFlags(const QModelIndex& index,
1230 bool* forceCompact) const

Callers 1

getIconsMethod · 0.80

Calls 10

dataMethod · 0.45
getFlagsMethod · 0.45
isSeparatorMethod · 0.45
settingsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
rowCountMethod · 0.45
indexMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected