| 1128 | } |
| 1129 | |
| 1130 | void ModList::removeRowForce(int row, const QModelIndex& parent) |
| 1131 | { |
| 1132 | if (static_cast<unsigned int>(row) >= ModInfo::getNumMods()) { |
| 1133 | return; |
| 1134 | } |
| 1135 | if (m_Profile == nullptr) |
| 1136 | return; |
| 1137 | |
| 1138 | ModInfo::Ptr modInfo = ModInfo::getByIndex(row); |
| 1139 | |
| 1140 | bool wasEnabled = m_Profile->modEnabled(row); |
| 1141 | |
| 1142 | m_Profile->setModEnabled(row, false); |
| 1143 | |
| 1144 | m_Profile->cancelModlistWrite(); |
| 1145 | beginRemoveRows(parent, row, row); |
| 1146 | ModInfo::removeMod(row); |
| 1147 | m_Profile->refreshModStatus(); // removes the mod from the status list |
| 1148 | endRemoveRows(); |
| 1149 | m_Profile->writeModlist(); // this ensures the modified list gets written back before |
| 1150 | // new mods can be installed |
| 1151 | |
| 1152 | notifyModRemoved(modInfo->name()); |
| 1153 | |
| 1154 | if (wasEnabled) { |
| 1155 | emit removeOrigin(modInfo->name()); |
| 1156 | } |
| 1157 | if (!modInfo->isBackup()) { |
| 1158 | emit modUninstalled(modInfo->installationFile()); |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | bool ModList::removeRows(int row, int count, const QModelIndex& parent) |
| 1163 | { |
no test coverage detected