| 1392 | } |
| 1393 | |
| 1394 | bool ModList::toggleState(const QModelIndexList& indices) |
| 1395 | { |
| 1396 | emit aboutToChangeData(); |
| 1397 | |
| 1398 | QList<unsigned int> modsToEnable; |
| 1399 | QList<unsigned int> modsToDisable; |
| 1400 | for (auto index : indices) { |
| 1401 | auto idx = index.data(IndexRole).toInt(); |
| 1402 | if (m_Profile->modEnabled(idx)) { |
| 1403 | modsToDisable.append(idx); |
| 1404 | } else { |
| 1405 | modsToEnable.append(idx); |
| 1406 | } |
| 1407 | } |
| 1408 | |
| 1409 | m_Profile->setModsEnabled(modsToEnable, modsToDisable); |
| 1410 | |
| 1411 | emit tutorialModlistUpdate(); |
| 1412 | |
| 1413 | m_Modified = true; |
| 1414 | m_LastCheck.restart(); |
| 1415 | |
| 1416 | emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1)); |
| 1417 | |
| 1418 | emit postDataChanged(); |
| 1419 | |
| 1420 | return true; |
| 1421 | } |
| 1422 | |
| 1423 | void ModList::setActive(const QModelIndexList& indices, bool active) |
| 1424 | { |
no test coverage detected