summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-05-25 19:53:21 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2020-05-25 19:54:15 +0200
commitcf1bbdd13e0db8856df672c367d3ec1610f6c556 (patch)
tree461a6b7623a186502f00b07df689ffebfea620b0 /src/mainwindow.cpp
parenta721347fd130fcab19f2709892093f087bfac19e (diff)
Switch to using the ModDataContent feature from the game plugin.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index de4a6b39..a720b621 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -311,7 +311,7 @@ MainWindow::MainWindow(Settings &settings
ui->statusBar->setAPI(ni->getAPIStats(), ni->getAPIUserAccount());
}
- m_Filters.reset(new FilterList(ui, m_CategoryFactory));
+ m_Filters.reset(new FilterList(ui, &m_OrganizerCore, m_CategoryFactory));
connect(
m_Filters.get(), &FilterList::criteriaChanged,
@@ -5950,7 +5950,9 @@ void MainWindow::onFiltersCriteria(const std::vector<ModListSortProxy::Criteria>
const auto& c = criteria[0];
if (c.type == ModListSortProxy::TypeContent) {
- label = ModInfo::getContentTypeName(c.id);
+ auto& contents = m_OrganizerCore.modDataContents();
+ auto it = std::find_if(std::begin(contents), std::end(contents), [&c](auto const& content) { return content.id() == c.id; });
+ label = it != std::end(contents) ? it->name() : QString();
} else {
label = m_CategoryFactory.getCategoryNameByID(c.id);
}