NOISSUE implement LEgacy instance migration

This commit is contained in:
Petr Mrázek 2017-09-26 13:38:34 +02:00
parent eac892965e
commit 2b998bb8cc
9 changed files with 179 additions and 62 deletions

View file

@ -430,6 +430,16 @@ Task * FolderInstanceProvider::copyTask(const InstancePtr& oldInstance, const QS
return new FolderInstanceStaging(this, task, stagingPath, instName, instGroup);
}
// FIXME: find a better place for this
#include "minecraft/legacy/LegacyUpgradeTask.h"
Task * FolderInstanceProvider::legacyUpgradeTask(const InstancePtr& oldInstance)
{
auto stagingPath = getStagedInstancePath();
QString newName = tr("%1 (Migrated)").arg(oldInstance->name());
auto task = new LegacyUpgradeTask(m_globalSettings, stagingPath, oldInstance, newName);
return new FolderInstanceStaging(this, task, stagingPath, newName, oldInstance->group());
}
QString FolderInstanceProvider::getStagedInstancePath()
{
QString key = QUuid::createUuid().toString();