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("."))
|
|
|
|
{
|
|
|
|
emitFailed(tr("Failed to create folder for minecraft binaries."));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
emitSucceeded();
|
2016-08-14 01:33:31 +01:00
|
|
|
}
|