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

Method createModFromOverwrite

src/modlistviewactions.cpp:1316–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1314}
1315
1316void ModListViewActions::createModFromOverwrite() const
1317{
1318 GuessedValue<QString> name;
1319 name.setFilter(&fixDirectoryName);
1320
1321 while (name->isEmpty()) {
1322 bool ok;
1323 name.update(
1324 QInputDialog::getText(
1325 m_parent, tr("Create Mod..."),
1326 tr("This will move all files from overwrite into a new, regular mod.\n"
1327 "Please enter a name:"),
1328 QLineEdit::Normal, "", &ok),
1329 GUESS_USER);
1330 if (!ok) {
1331 return;
1332 }
1333 }
1334
1335 if (m_core.modList()->getMod(name) != nullptr) {
1336 reportError(tr("A mod with this name already exists"));
1337 return;
1338 }
1339
1340 const IModInterface* newMod = m_core.createMod(name);
1341 if (newMod == nullptr) {
1342 return;
1343 }
1344
1345 moveOverwriteContentsTo(newMod->absolutePath());
1346}
1347
1348void ModListViewActions::moveOverwriteContentToExistingMod() const
1349{

Callers 1

addOverwriteActionsMethod · 0.80

Calls 6

isEmptyMethod · 0.45
updateMethod · 0.45
getModMethod · 0.45
modListMethod · 0.45
createModMethod · 0.45
absolutePathMethod · 0.45

Tested by

no test coverage detected