MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / disableUpdates

Method disableUpdates

launcher/ui/pages/instance/ModFolderPage.cpp:266–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void ModFolderPage::disableUpdates()
267{
268 auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
269 auto mods_list = m_model->selectedMods(selection);
270
271 for (auto mod : mods_list) {
272 if(mod->metadata() && mod->metadata()->hasDoUpdates()) {
273 mod->metadata()->do_updates == "true" ? mod->metadata()->do_updates = "false" : mod->metadata()->do_updates = "true";
274 QDir Dir = m_model->indexDir();
275 Metadata::update(Dir, *(mod->metadata()));
276 } else if(!mod->metadata()) {
277 ModUpdateDialog MetadataGenDialog(this, m_instance, m_model, mods_list, false);
278 MetadataGenDialog.ensureMetadata();
279 if(mods_list.length()>1){
280 mod->metadata()->do_updates = "false";
281 }
282 }
283 }
284
285 onDisableUpdatesChange();
286}
287
288void ModFolderPage::onDisableUpdatesChange()
289{

Callers

nothing calls this directly

Calls 6

selectedModsMethod · 0.80
metadataMethod · 0.80
hasDoUpdatesMethod · 0.80
ensureMetadataMethod · 0.80
lengthMethod · 0.80
indexDirMethod · 0.45

Tested by

no test coverage detected