feat: Use version filter when searching mods

This commit is contained in:
flow
2022-04-02 18:34:26 -03:00
parent c2b97c3e3f
commit c730fd6e5f
5 changed files with 23 additions and 21 deletions

View File

@ -72,7 +72,7 @@ void ListModel::performPaginatedSearch()
auto profile = (dynamic_cast<MinecraftInstance*>((dynamic_cast<ModPage*>(parent()))->m_instance))->getPackProfile();
m_parent->apiProvider()->searchMods(this,
{ nextSearchOffset, currentSearchTerm, getSorts()[currentSort], profile->getModLoader(), getMineVersions().at(0) });
{ nextSearchOffset, currentSearchTerm, getSorts()[currentSort], profile->getModLoader(), getMineVersions() });
}
void ListModel::searchWithTerm(const QString& term, const int sort)
@ -223,9 +223,7 @@ void ListModel::versionRequestSucceeded(QJsonDocument doc, QString addonId)
/******** Helpers ********/
auto ModPlatform::ListModel::getMineVersions() const -> QList<QString>
auto ModPlatform::ListModel::getMineVersions() const -> std::list<Version>
{
return { (dynamic_cast<MinecraftInstance*>((dynamic_cast<ModPage*>(parent()))->m_instance))
->getPackProfile()
->getComponentVersion("net.minecraft") };
return m_parent->getFilter()->versions;
}