summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-12-29 13:27:29 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:16 +0100
commitf923de39e071b48bc1437fa4c79c22b3bc9b0583 (patch)
treed92bace851cb6198e5f5e6b48bf5249e234705cb /src/mainwindow.cpp
parent25d852f07564883f5a225eb0e00e883cae30cbd2 (diff)
Maintain selection while filtering.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 7c72f132..69e2d989 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -422,10 +422,6 @@ MainWindow::MainWindow(Settings &settings
connect(&m_PluginContainer, SIGNAL(diagnosisUpdate()), this, SLOT(scheduleCheckForProblems()));
- connect(m_ModListSortProxy, SIGNAL(filterActive(bool)), this, SLOT(modFilterActive(bool)));
- connect(m_ModListSortProxy, SIGNAL(layoutChanged()), this, SLOT(updateModCount()));
- connect(ui->modFilterEdit, SIGNAL(textChanged(QString)), m_ModListSortProxy, SLOT(updateFilter(QString)));
-
connect(ui->espFilterEdit, SIGNAL(textChanged(QString)), m_PluginListSortProxy, SLOT(updateFilter(QString)));
connect(ui->espFilterEdit, SIGNAL(textChanged(QString)), this, SLOT(espFilterChanged(QString)));
@@ -659,6 +655,15 @@ void MainWindow::setupModList()
connect(m_OrganizerCore.modList(), &ModList::downloadArchiveDropped, this, [this](int row, int priority) {
m_OrganizerCore.installDownload(row, priority);
});
+
+ connect(m_ModListSortProxy, &ModListSortProxy::filterActive, this, &MainWindow::modFilterActive);
+ connect(ui->modFilterEdit, &QLineEdit::textChanged, m_ModListSortProxy, &ModListSortProxy::updateFilter);
+ connect(m_ModListSortProxy, &QAbstractItemModel::layoutChanged, this, &MainWindow::updateModCount);
+ connect(m_ModListSortProxy, &QAbstractItemModel::layoutChanged, this, [&]() {
+ if (m_ModListSortProxy->sourceModel() == m_ModListByPriorityProxy) {
+ m_ModListByPriorityProxy->refreshExpandedItems();
+ }
+ });
}
void MainWindow::resetActionIcons()
@@ -5835,7 +5840,6 @@ void MainWindow::onFiltersCriteria(const std::vector<ModListSortProxy::Criteria>
}
ui->currentCategoryLabel->setText(label);
- ui->modList->reset();
}
void MainWindow::onFiltersOptions(