From 1e2297604b797f1ea15d91b43f227114deedaeb0 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 27 Dec 2020 18:45:06 +0100 Subject: Restrict collapsible separators to sort-by-priority in ascending order. --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 173dc53d..15564c21 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -561,7 +561,7 @@ void MainWindow::setupModList() connect(m_ModListSortProxy, &QAbstractItemModel::layoutAboutToBeChanged, this, [this](const QList& parents, QAbstractItemModel::LayoutChangeHint hint) { if (hint == QAbstractItemModel::VerticalSortHint) { - if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) { + if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY && m_ModListSortProxy->sortOrder() == Qt::AscendingOrder) { m_ModListSortProxy->setSourceModel(m_ModListByPriorityProxy); emit m_OrganizerCore.modList()->layoutChanged(); } @@ -5964,7 +5964,7 @@ void MainWindow::on_groupCombo_currentIndexChanged(int index) connect(ui->modList, SIGNAL(collapsed(QModelIndex)), newModel, SLOT(collapsed(QModelIndex))); connect(newModel, SIGNAL(expandItem(QModelIndex)), this, SLOT(expandModList(QModelIndex))); } else { - if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) { + if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY && m_ModListSortProxy->sortOrder() == Qt::AscendingOrder) { m_ModListSortProxy->setSourceModel(m_ModListByPriorityProxy); emit m_OrganizerCore.modList()->layoutChanged(); } -- cgit v1.3.1