summaryrefslogtreecommitdiff
path: root/src/modconflicticondelegate.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-03 16:30:35 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-03 16:30:35 +0100
commitfbd7e777d76c2032d8c4df418e5550b14b9c2943 (patch)
treefb066683c4641c7e80579a37416c93f4fcf01a49 /src/modconflicticondelegate.cpp
parentf7647b985b791959ecdfc9896a77fa51ac784f85 (diff)
Add option to enable/disable displaying conflicts on collapsed separators.
Diffstat (limited to 'src/modconflicticondelegate.cpp')
-rw-r--r--src/modconflicticondelegate.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/modconflicticondelegate.cpp b/src/modconflicticondelegate.cpp
index cbc32037..73c47a03 100644
--- a/src/modconflicticondelegate.cpp
+++ b/src/modconflicticondelegate.cpp
@@ -93,28 +93,9 @@ QList<QString> ModConflictIconDelegate::getIcons(const QModelIndex &index) const
return {};
}
- ModInfo::Ptr info = ModInfo::getByIndex(modIndex.toInt());
-
- auto flags = info->getConflictFlags();
- bool compact = m_Compact;
- if (info->isSeparator()
- && m_View->hasCollapsibleSeparators()
- && !m_View->isExpanded(index.sibling(index.row(), 0))) {
-
- // combine the child conflicts
- std::set<ModInfo::EConflictFlag> eFlags(flags.begin(), flags.end());
- for (int i = 0; i < m_View->model()->rowCount(index); ++i) {
- auto cIndex = m_View->model()->index(i, index.column(), index).data(ModList::IndexRole).toInt();
- auto cFlags = ModInfo::getByIndex(cIndex)->getConflictFlags();
- eFlags.insert(cFlags.begin(), cFlags.end());
- }
- flags = { eFlags.begin(), eFlags.end() };
-
- // force compact because there can be a lots of flags here
- compact = true;
- }
-
- return getIconsForFlags(flags, compact);
+ bool compact;
+ auto flags = m_View->conflictFlags(index, &compact);
+ return getIconsForFlags(flags, compact || m_Compact);
}
QString ModConflictIconDelegate::getFlagIcon(ModInfo::EConflictFlag flag)