Skip to content

Commit

Permalink
NOISSUE Rename OneSixUpdate to MinecraftUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed Nov 11, 2018
1 parent defa911 commit d636740
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion api/logic/minecraft/MinecraftInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions api/logic/minecraft/MinecraftLoadAndCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
40 changes: 20 additions & 20 deletions api/logic/minecraft/MinecraftUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -83,7 +83,7 @@ void OneSixUpdate::executeTask()
next();
}

void OneSixUpdate::next()
void MinecraftUpdate::next()
{
if(m_abort)
{
Expand All @@ -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())
{
Expand All @@ -113,49 +113,49 @@ 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())
{
task->start();
}
}

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;
Expand All @@ -164,7 +164,7 @@ void OneSixUpdate::subtaskFailed(QString error)
}


bool OneSixUpdate::abort()
bool MinecraftUpdate::abort()
{
if(!m_abort)
{
Expand All @@ -178,7 +178,7 @@ bool OneSixUpdate::abort()
return true;
}

bool OneSixUpdate::canAbort() const
bool MinecraftUpdate::canAbort() const
{
return true;
}
6 changes: 3 additions & 3 deletions api/logic/minecraft/MinecraftUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d636740

Please sign in to comment.