Offline mode support, part 1

Refactor MojangAccount so it exposes a less generic interface and supports login. Hide the ugly details.
Yggdrasil tasks are now only used from MojangAccount.
This commit is contained in:
Petr Mrázek
2013-12-05 02:39:52 +01:00
parent 613699b362
commit f028aa76bc
18 changed files with 265 additions and 322 deletions

View File

@ -31,7 +31,7 @@ class YggdrasilTask : public Task
{
Q_OBJECT
public:
explicit YggdrasilTask(MojangAccountPtr account, QObject *parent = 0);
explicit YggdrasilTask(MojangAccount * account, QObject *parent = 0);
~YggdrasilTask();
/**
@ -59,11 +59,6 @@ public:
QString m_cause;
};
/**
* Gets the Mojang account that this task is operating on.
*/
virtual MojangAccountPtr getMojangAccount() const;
/**
* Returns a pointer to a YggdrasilTask::Error object if an error has occurred.
* If no error has occurred, returns a null pointer.
@ -120,11 +115,11 @@ protected:
*/
virtual QString getStateMessage(const State state) const;
MojangAccountPtr m_account;
MojangAccount *m_account = nullptr;
QNetworkReply *m_netReply;
Error *m_error;
Error *m_error = nullptr;
protected
slots: