GH-352 Make OneSix instance update downloads cancellable
This commit is contained in:
20
api/logic/minecraft/onesix/update/FoldersTask.cpp
Normal file
20
api/logic/minecraft/onesix/update/FoldersTask.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "FoldersTask.h"
|
||||
#include "minecraft/onesix/OneSixInstance.h"
|
||||
#include <QDir>
|
||||
|
||||
FoldersTask::FoldersTask(OneSixInstance * inst)
|
||||
{
|
||||
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();
|
||||
}
|
Reference in New Issue
Block a user