summaryrefslogtreecommitdiffstats
path: root/libmultimc/src/logintask.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-03-11 22:19:17 +0100
committerPetr Mrázek <peterix@gmail.com>2013-03-11 22:19:17 +0100
commit46f93311afc9f1e2afc306f63cee0e4f462758e2 (patch)
treecc945d66e6ca5e68c43b354d3f8f6d6e70cf5326 /libmultimc/src/logintask.cpp
parent36396f7c6aca9fcc61c8620e10c31ed2c8999ebd (diff)
downloadMultiMC-46f93311afc9f1e2afc306f63cee0e4f462758e2.tar
MultiMC-46f93311afc9f1e2afc306f63cee0e4f462758e2.tar.gz
MultiMC-46f93311afc9f1e2afc306f63cee0e4f462758e2.tar.lz
MultiMC-46f93311afc9f1e2afc306f63cee0e4f462758e2.tar.xz
MultiMC-46f93311afc9f1e2afc306f63cee0e4f462758e2.zip
Instance view, model, delegate.
Diffstat (limited to 'libmultimc/src/logintask.cpp')
-rw-r--r--libmultimc/src/logintask.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/libmultimc/src/logintask.cpp b/libmultimc/src/logintask.cpp
index 71075630..e042a93f 100644
--- a/libmultimc/src/logintask.cpp
+++ b/libmultimc/src/logintask.cpp
@@ -24,8 +24,8 @@
#include <QUrl>
#include <QUrlQuery>
-LoginTask::LoginTask(const UserInfo &uInfo, QObject *parent) :
- Task(parent), uInfo(uInfo)
+LoginTask::LoginTask( const UserInfo& uInfo, QString inst, QObject* parent ) :
+ Task(parent), uInfo(uInfo), inst(inst)
{
}
@@ -78,42 +78,42 @@ void LoginTask::processNetReply(QNetworkReply *reply)
QString sessionID = strings[3];
LoginResponse response(username, sessionID, latestVersion);
- emit loginComplete(response);
+ emit loginComplete(inst, response);
}
else
{
- emit loginFailed("Failed to parse Minecraft version string.");
+ emit loginFailed(inst, "Failed to parse Minecraft version string.");
}
}
else
{
if (responseStr.toLower() == "bad login")
- emit loginFailed("Invalid username or password.");
+ emit loginFailed(inst, "Invalid username or password.");
else if (responseStr.toLower() == "old version")
- emit loginFailed("Launcher outdated, please update.");
+ emit loginFailed(inst, "Launcher outdated, please update.");
else
- emit loginFailed("Login failed: " + responseStr);
+ emit loginFailed(inst, "Login failed: " + responseStr);
}
}
else if (responseCode == 503)
{
- emit loginFailed("The login servers are currently unavailable. "
+ emit loginFailed(inst, "The login servers are currently unavailable. "
"Check http://help.mojang.com/ for more info.");
}
else
{
- emit loginFailed(QString("Login failed: Unknown HTTP error %1 occurred.").
+ emit loginFailed(inst, QString("Login failed: Unknown HTTP error %1 occurred.").
arg(QString::number(responseCode)));
}
break;
}
case QNetworkReply::OperationCanceledError:
- emit loginFailed("Login canceled.");
+ emit loginFailed(inst, "Login canceled.");
break;
default:
- emit loginFailed("Login failed: " + reply->errorString());
+ emit loginFailed(inst, "Login failed: " + reply->errorString());
break;
}