diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-30 14:39:24 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 15:38:16 +0100 |
| commit | 1efa793290a533b018271ca8442004e366da58db (patch) | |
| tree | 5a94b32983ef2728955e3b7da1f8bb23146ef719 /src | |
| parent | 53d6460558c1f998aa69071d0a6cd9cc58720a98 (diff) | |
Expand separator after drop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistview.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
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<int> 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());
}
}
|
