2016-08-14 00:33:31 +00:00
|
|
|
#include "FoldersTask.h"
|
2017-07-24 07:01:37 +00:00
|
|
|
#include "minecraft/MinecraftInstance.h"
|
2016-08-14 00:33:31 +00:00
|
|
|
#include <QDir>
|
|
|
|
|
2017-07-24 07:01:37 +00:00
|
|
|
FoldersTask::FoldersTask(MinecraftInstance * inst)
|
2017-07-07 17:46:56 +00:00
|
|
|
:Task()
|
2016-08-14 00:33:31 +00:00
|
|
|
{
|
|
|
|
m_inst = inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FoldersTask::executeTask()
|
|
|
|
{
|
|
|
|
// Make directories
|
|
|
|
QDir mcDir(m_inst->minecraftRoot());
|
|
|
|
if (!mcDir.exists() && !mcDir.mkpath("."))
|
|
|
|
{
|
|
|
|
emitFailed(tr("Failed to create folder for minecraft binaries."));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
emitSucceeded();
|
|
|
|
}
|