pollymc/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 18:21:05 +05:30
:Task()
{
2018-07-15 18:21:05 +05:30
m_inst = inst;
}
void FoldersTask::executeTask()
{
2018-07-15 18:21:05 +05:30
// Make directories
QDir mcDir(m_inst->gameRoot());
2018-07-15 18:21:05 +05:30
if (!mcDir.exists() && !mcDir.mkpath("."))
{
emitFailed(tr("Failed to create folder for minecraft binaries."));
return;
}
emitSucceeded();
}