From 1efa793290a533b018271ca8442004e366da58db Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Wed, 30 Dec 2020 14:39:24 +0100 Subject: Expand separator after drop. --- src/modlistview.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index 3e8c50e5..74f4b566 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -353,13 +353,14 @@ void ModListView::expandItem(const QModelIndex& index) { void ModListView::onModPrioritiesChanged(std::vector const& indices) { - // expand separator whose priority has changed - if (hasCollapsibleSeparators()) { - for (auto index : indices) { - ModInfo::Ptr modInfo = ModInfo::getByIndex(index); - if (modInfo->isSeparator()) { - expand(indexModelToView(m_core->modList()->index(index, 0))); - } + // expand separator whose priority has changed + for (auto index : indices) { + auto idx = indexModelToView(m_core->modList()->index(index, 0)); + if (hasCollapsibleSeparators() && model()->hasChildren(idx)) { + expand(idx); + } + if (idx.parent().isValid()) { + expand(idx.parent()); } } -- cgit v1.3.1