mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Implement mod update function
This commit is contained in:
@@ -581,6 +581,11 @@ QStringList CModListView::getModsToInstall(QString mod)
|
||||
void CModListView::on_updateButton_clicked()
|
||||
{
|
||||
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
||||
doUpdateMod(modName);
|
||||
}
|
||||
|
||||
void CModListView::doUpdateMod(const QString & modName)
|
||||
{
|
||||
auto targetMod = modStateModel->getMod(modName);
|
||||
|
||||
if(targetMod.isUpdateAvailable())
|
||||
@@ -994,6 +999,20 @@ QStringList CModListView::getInstalledChronicles()
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList CModListView::getUpdateableMods()
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
for(const auto & modName : modStateModel->getAllMods())
|
||||
{
|
||||
auto mod = modStateModel->getMod(modName);
|
||||
if (mod.isUpdateAvailable())
|
||||
result.push_back(modName);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QString CModListView::getTranslationModName(const QString & language)
|
||||
{
|
||||
for(const auto & modName : modStateModel->getAllMods())
|
||||
|
||||
Reference in New Issue
Block a user