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