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)
|
2017-07-07 23:16:56 +05:30
|
|
|
:Task()
|
2016-08-14 06:03:31 +05:30
|
|
|
{
|
|
|
|
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();
|
|
|
|
}
|