MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / removeRowForce

Method removeRowForce

src/modlist.cpp:1130–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130void 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
1162bool ModList::removeRows(int row, int count, const QModelIndex& parent)
1163{

Callers 1

removeModsMethod · 0.80

Calls 8

modEnabledMethod · 0.80
setModEnabledMethod · 0.80
cancelModlistWriteMethod · 0.80
refreshModStatusMethod · 0.80
writeModlistMethod · 0.80
nameMethod · 0.45
isBackupMethod · 0.45
installationFileMethod · 0.45

Tested by

no test coverage detected