sneedmc/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("."))
{
2022-03-18 12:19:09 +00:00
emitFailed(tr("Failed to create folder for Minecraft binaries."));
2018-07-15 12:51:05 +00:00
return;
}
emitSucceeded();
}