2016-08-14 01:33:31 +01:00
|
|
|
#include "FoldersTask.h"
|
2017-07-24 08:01:37 +01:00
|
|
|
#include "minecraft/MinecraftInstance.h"
|
2016-08-14 01:33:31 +01:00
|
|
|
#include <QDir>
|
|
|
|
|
2017-07-24 08:01:37 +01:00
|
|
|
FoldersTask::FoldersTask(MinecraftInstance * inst)
|
2018-07-15 13:51:05 +01:00
|
|
|
:Task()
|
2016-08-14 01:33:31 +01:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
m_inst = inst;
|
2016-08-14 01:33:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void FoldersTask::executeTask()
|
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
// Make directories
|
2018-07-27 22:57:09 +01:00
|
|
|
QDir mcDir(m_inst->gameRoot());
|
2018-07-15 13:51:05 +01:00
|
|
|
if (!mcDir.exists() && !mcDir.mkpath("."))
|
|
|
|
{
|
2022-03-18 12:19:09 +00:00
|
|
|
emitFailed(tr("Failed to create folder for Minecraft binaries."));
|
2018-07-15 13:51:05 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
emitSucceeded();
|
2016-08-14 01:33:31 +01:00
|
|
|
}
|