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