summaryrefslogtreecommitdiffstats
path: root/logic/auth/flows/ValidateTask.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-04-06 20:31:02 +0200
committerPetr Mrázek <peterix@gmail.com>2014-04-16 00:46:41 +0200
commitb286b9328158ad7686b7787d54c857e973c5b74c (patch)
tree1b6b7758dbd6f3466cae3296aea5d11d6bf7e8ab /logic/auth/flows/ValidateTask.cpp
parent632c087483a6ab714486ac5f9465c4752f1219a5 (diff)
downloadMultiMC-b286b9328158ad7686b7787d54c857e973c5b74c.tar
MultiMC-b286b9328158ad7686b7787d54c857e973c5b74c.tar.gz
MultiMC-b286b9328158ad7686b7787d54c857e973c5b74c.tar.lz
MultiMC-b286b9328158ad7686b7787d54c857e973c5b74c.tar.xz
MultiMC-b286b9328158ad7686b7787d54c857e973c5b74c.zip
Give more feedback for YggdrasilTask network errors.
Diffstat (limited to 'logic/auth/flows/ValidateTask.cpp')
-rw-r--r--logic/auth/flows/ValidateTask.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/logic/auth/flows/ValidateTask.cpp b/logic/auth/flows/ValidateTask.cpp
index 4f7323fd..f3fc1e71 100644
--- a/logic/auth/flows/ValidateTask.cpp
+++ b/logic/auth/flows/ValidateTask.cpp
@@ -38,11 +38,10 @@ QJsonObject ValidateTask::getRequestContent() const
return req;
}
-bool ValidateTask::processResponse(QJsonObject responseData)
+void ValidateTask::processResponse(QJsonObject responseData)
{
// Assume that if processError wasn't called, then the request was successful.
- emitSucceeded();
- return true;
+ changeState(YggdrasilTask::STATE_SUCCEEDED);
}
QString ValidateTask::getEndpoint() const
@@ -50,15 +49,15 @@ QString ValidateTask::getEndpoint() const
return "validate";
}
-QString ValidateTask::getStateMessage(const YggdrasilTask::State state) const
+QString ValidateTask::getStateMessage() const
{
- switch (state)
+ switch (m_state)
{
- case STATE_SENDING_REQUEST:
+ case YggdrasilTask::STATE_SENDING_REQUEST:
return tr("Validating access token: Sending request...");
- case STATE_PROCESSING_RESPONSE:
+ case YggdrasilTask::STATE_PROCESSING_RESPONSE:
return tr("Validating access token: Processing response...");
default:
- return YggdrasilTask::getStateMessage(state);
+ return YggdrasilTask::getStateMessage();
}
}