MultiMC5/launcher/minecraft/update/FoldersTask.cpp

22 lines
437 B
C++
Raw Normal View History

#include "FoldersTask.h"
#include "minecraft/MinecraftInstance.h"
#include <QDir>
FoldersTask::FoldersTask(MinecraftInstance * inst)
2018-07-15 12:51:05 +00:00
:Task()
{
2018-07-15 12:51:05 +00:00
m_inst = inst;
}
void FoldersTask::executeTask()
{
2018-07-15 12:51:05 +00:00
// Make directories
QDir mcDir(m_inst->gameRoot());
2018-07-15 12:51:05 +00:00
if (!mcDir.exists() && !mcDir.mkpath("."))
{
emitFailed(tr("Failed to create folder for minecraft binaries."));
return;
}
emitSucceeded();
}