Added smart file selection

This might fail in a few special cases
This commit is contained in:
timoreo
2022-01-15 10:25:24 +01:00
parent f6de472da2
commit 621e0ba4a8
4 changed files with 43 additions and 10 deletions

View File

@ -128,7 +128,7 @@ void ModrinthPage::onSelectionChanged(QModelIndex first, QModelIndex second)
QJsonArray arr = doc.array();
try
{
Modrinth::loadIndexedPackVersions(current, arr, APPLICATION->network());
Modrinth::loadIndexedPackVersions(current, arr, APPLICATION->network(), m_instance);
}
catch(const JSONValidationError &e)
{
@ -145,7 +145,7 @@ void ModrinthPage::onSelectionChanged(QModelIndex first, QModelIndex second)
ui->versionSelectionBox->addItem(version.version, QVariant(version.downloadUrl));
}
if(ui->versionSelectionBox->count() == 0){
ui->versionSelectionBox->addItem("No Valid Version found !", QVariant(""));
ui->versionSelectionBox->addItem(tr("No Valid Version found !"), QVariant(""));
}
suggestCurrent();
@ -158,7 +158,7 @@ void ModrinthPage::onSelectionChanged(QModelIndex first, QModelIndex second)
ui->versionSelectionBox->addItem(version.version, QVariant(version.downloadUrl));
}
if(ui->versionSelectionBox->count() == 0){
ui->versionSelectionBox->addItem("No Valid Version found !", QVariant(""));
ui->versionSelectionBox->addItem(tr("No Valid Version found !"), QVariant(""));
}
suggestCurrent();
}