summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp27
-rw-r--r--src/mainwindow.h1
2 files changed, 14 insertions, 14 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 7f9e81fc..74f3fd62 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -546,6 +546,17 @@ MainWindow::MainWindow(Settings &settings
ui->statusBar->updateNormalMessage(m_OrganizerCore);
}
+void MainWindow::updateModListByPriorityProxy()
+{
+ if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY && m_ModListSortProxy->sortOrder() == Qt::AscendingOrder) {
+ m_ModListSortProxy->setSourceModel(m_ModListByPriorityProxy);
+ emit m_OrganizerCore.modList()->layoutChanged();
+ }
+ else {
+ m_ModListSortProxy->setSourceModel(m_OrganizerCore.modList());
+ }
+}
+
void MainWindow::setupModList()
{
m_ModListByPriorityProxy = new ModListByPriorityProxy(m_OrganizerCore.currentProfile(), &m_OrganizerCore);
@@ -561,13 +572,7 @@ void MainWindow::setupModList()
connect(m_ModListSortProxy, &QAbstractItemModel::layoutAboutToBeChanged,
this, [this](const QList<QPersistentModelIndex>& parents, QAbstractItemModel::LayoutChangeHint hint) {
if (hint == QAbstractItemModel::VerticalSortHint) {
- if (m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY && m_ModListSortProxy->sortOrder() == Qt::AscendingOrder) {
- m_ModListSortProxy->setSourceModel(m_ModListByPriorityProxy);
- emit m_OrganizerCore.modList()->layoutChanged();
- }
- else {
- m_ModListSortProxy->setSourceModel(m_OrganizerCore.modList());
- }
+ updateModListByPriorityProxy();
}
});
@@ -5968,13 +5973,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 && m_ModListSortProxy->sortOrder() == Qt::AscendingOrder) {
- m_ModListSortProxy->setSourceModel(m_ModListByPriorityProxy);
- emit m_OrganizerCore.modList()->layoutChanged();
- }
- else {
- m_ModListSortProxy->setSourceModel(m_OrganizerCore.modList());
- }
+ updateModListByPriorityProxy();
}
modFilterActive(m_ModListSortProxy->isFilterActive());
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 19a1b179..ccfd4881 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -608,6 +608,7 @@ private slots: // ui slots
void storeSettings();
void readSettings();
void setupModList();
+ void updateModListByPriorityProxy();
};
#endif // MAINWINDOW_H