MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / undoTrashInstance

Method undoTrashInstance

launcher/InstanceList.cpp:366–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void InstanceList::undoTrashInstance()
367{
368 if (m_trashHistory.empty()) {
369 qWarning() << "Nothing to recover from trash.";
370 return;
371 }
372
373 auto top = m_trashHistory.pop();
374
375 while (QDir(top.path).exists()) {
376 top.id += "1";
377 top.path += "1";
378 }
379
380 qDebug() << "Moving" << top.trashPath << "back to" << top.path;
381 QFile(top.trashPath).rename(top.path);
382
383 m_instanceGroupIndex[top.id] = top.groupName;
384 increaseGroupCount(top.groupName);
385
386 saveGroupList();
387 emit instancesChanged();
388}
389
390void InstanceList::deleteInstance(const InstanceId& id)
391{

Callers

nothing calls this directly

Calls 5

QFileClass · 0.85
existsMethod · 0.80
QDirClass · 0.70
emptyMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected