From fbd7e777d76c2032d8c4df418e5550b14b9c2943 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 3 Jan 2021 16:30:35 +0100 Subject: Add option to enable/disable displaying conflicts on collapsed separators. --- src/modconflicticondelegate.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/modconflicticondelegate.cpp') 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 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 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) -- cgit v1.3.1