NOISSUE Rename OneSixUpdate to MinecraftUpdate
This commit is contained in:
parent
defa911705
commit
d6367407b0
@ -765,7 +765,7 @@ shared_qobject_ptr<Task> MinecraftInstance::createUpdateTask(Net::Mode mode)
|
||||
}
|
||||
case Net::Mode::Online:
|
||||
{
|
||||
return shared_qobject_ptr<Task>(new OneSixUpdate(this));
|
||||
return shared_qobject_ptr<Task>(new MinecraftUpdate(this));
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -28,7 +28,7 @@ void MinecraftLoadAndCheck::subtaskSucceeded()
|
||||
{
|
||||
if(isFinished())
|
||||
{
|
||||
qCritical() << "OneSixUpdate: Subtask" << sender() << "succeeded, but work was already done!";
|
||||
qCritical() << "MinecraftUpdate: Subtask" << sender() << "succeeded, but work was already done!";
|
||||
return;
|
||||
}
|
||||
emitSucceeded();
|
||||
@ -38,7 +38,7 @@ void MinecraftLoadAndCheck::subtaskFailed(QString error)
|
||||
{
|
||||
if(isFinished())
|
||||
{
|
||||
qCritical() << "OneSixUpdate: Subtask" << sender() << "failed, but work was already done!";
|
||||
qCritical() << "MinecraftUpdate: Subtask" << sender() << "failed, but work was already done!";
|
||||
return;
|
||||
}
|
||||
emitFailed(error);
|
||||
|
@ -37,11 +37,11 @@
|
||||
#include <meta/Index.h>
|
||||
#include <meta/Version.h>
|
||||
|
||||
OneSixUpdate::OneSixUpdate(MinecraftInstance *inst, QObject *parent) : Task(parent), m_inst(inst)
|
||||
MinecraftUpdate::MinecraftUpdate(MinecraftInstance *inst, QObject *parent) : Task(parent), m_inst(inst)
|
||||
{
|
||||
}
|
||||
|
||||
void OneSixUpdate::executeTask()
|
||||
void MinecraftUpdate::executeTask()
|
||||
{
|
||||
m_tasks.clear();
|
||||
// create folders
|
||||
@ -83,7 +83,7 @@ void OneSixUpdate::executeTask()
|
||||
next();
|
||||
}
|
||||
|
||||
void OneSixUpdate::next()
|
||||
void MinecraftUpdate::next()
|
||||
{
|
||||
if(m_abort)
|
||||
{
|
||||
@ -99,10 +99,10 @@ void OneSixUpdate::next()
|
||||
if(m_currentTask > 0)
|
||||
{
|
||||
auto task = m_tasks[m_currentTask - 1];
|
||||
disconnect(task.get(), &Task::succeeded, this, &OneSixUpdate::subtaskSucceeded);
|
||||
disconnect(task.get(), &Task::failed, this, &OneSixUpdate::subtaskFailed);
|
||||
disconnect(task.get(), &Task::progress, this, &OneSixUpdate::progress);
|
||||
disconnect(task.get(), &Task::status, this, &OneSixUpdate::setStatus);
|
||||
disconnect(task.get(), &Task::succeeded, this, &MinecraftUpdate::subtaskSucceeded);
|
||||
disconnect(task.get(), &Task::failed, this, &MinecraftUpdate::subtaskFailed);
|
||||
disconnect(task.get(), &Task::progress, this, &MinecraftUpdate::progress);
|
||||
disconnect(task.get(), &Task::status, this, &MinecraftUpdate::setStatus);
|
||||
}
|
||||
if(m_currentTask == m_tasks.size())
|
||||
{
|
||||
@ -113,13 +113,13 @@ void OneSixUpdate::next()
|
||||
// if the task is already finished by the time we look at it, skip it
|
||||
if(task->isFinished())
|
||||
{
|
||||
qCritical() << "OneSixUpdate: Skipping finished subtask" << m_currentTask << ":" << task.get();
|
||||
qCritical() << "MinecraftUpdate: Skipping finished subtask" << m_currentTask << ":" << task.get();
|
||||
next();
|
||||
}
|
||||
connect(task.get(), &Task::succeeded, this, &OneSixUpdate::subtaskSucceeded);
|
||||
connect(task.get(), &Task::failed, this, &OneSixUpdate::subtaskFailed);
|
||||
connect(task.get(), &Task::progress, this, &OneSixUpdate::progress);
|
||||
connect(task.get(), &Task::status, this, &OneSixUpdate::setStatus);
|
||||
connect(task.get(), &Task::succeeded, this, &MinecraftUpdate::subtaskSucceeded);
|
||||
connect(task.get(), &Task::failed, this, &MinecraftUpdate::subtaskFailed);
|
||||
connect(task.get(), &Task::progress, this, &MinecraftUpdate::progress);
|
||||
connect(task.get(), &Task::status, this, &MinecraftUpdate::setStatus);
|
||||
// if the task is already running, do not start it again
|
||||
if(!task->isRunning())
|
||||
{
|
||||
@ -127,35 +127,35 @@ void OneSixUpdate::next()
|
||||
}
|
||||
}
|
||||
|
||||
void OneSixUpdate::subtaskSucceeded()
|
||||
void MinecraftUpdate::subtaskSucceeded()
|
||||
{
|
||||
if(isFinished())
|
||||
{
|
||||
qCritical() << "OneSixUpdate: Subtask" << sender() << "succeeded, but work was already done!";
|
||||
qCritical() << "MinecraftUpdate: Subtask" << sender() << "succeeded, but work was already done!";
|
||||
return;
|
||||
}
|
||||
auto senderTask = QObject::sender();
|
||||
auto currentTask = m_tasks[m_currentTask].get();
|
||||
if(senderTask != currentTask)
|
||||
{
|
||||
qDebug() << "OneSixUpdate: Subtask" << sender() << "succeeded out of order.";
|
||||
qDebug() << "MinecraftUpdate: Subtask" << sender() << "succeeded out of order.";
|
||||
return;
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
||||
void OneSixUpdate::subtaskFailed(QString error)
|
||||
void MinecraftUpdate::subtaskFailed(QString error)
|
||||
{
|
||||
if(isFinished())
|
||||
{
|
||||
qCritical() << "OneSixUpdate: Subtask" << sender() << "failed, but work was already done!";
|
||||
qCritical() << "MinecraftUpdate: Subtask" << sender() << "failed, but work was already done!";
|
||||
return;
|
||||
}
|
||||
auto senderTask = QObject::sender();
|
||||
auto currentTask = m_tasks[m_currentTask].get();
|
||||
if(senderTask != currentTask)
|
||||
{
|
||||
qDebug() << "OneSixUpdate: Subtask" << sender() << "failed out of order.";
|
||||
qDebug() << "MinecraftUpdate: Subtask" << sender() << "failed out of order.";
|
||||
m_failed_out_of_order = true;
|
||||
m_fail_reason = error;
|
||||
return;
|
||||
@ -164,7 +164,7 @@ void OneSixUpdate::subtaskFailed(QString error)
|
||||
}
|
||||
|
||||
|
||||
bool OneSixUpdate::abort()
|
||||
bool MinecraftUpdate::abort()
|
||||
{
|
||||
if(!m_abort)
|
||||
{
|
||||
@ -178,7 +178,7 @@ bool OneSixUpdate::abort()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OneSixUpdate::canAbort() const
|
||||
bool MinecraftUpdate::canAbort() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -27,12 +27,12 @@
|
||||
class MinecraftVersion;
|
||||
class MinecraftInstance;
|
||||
|
||||
class OneSixUpdate : public Task
|
||||
class MinecraftUpdate : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit OneSixUpdate(MinecraftInstance *inst, QObject *parent = 0);
|
||||
virtual ~OneSixUpdate() {};
|
||||
explicit MinecraftUpdate(MinecraftInstance *inst, QObject *parent = 0);
|
||||
virtual ~MinecraftUpdate() {};
|
||||
|
||||
void executeTask() override;
|
||||
bool canAbort() const override;
|
||||
|
Loading…
Reference in New Issue
Block a user