Implement loading accounts from list.
This commit is contained in:
@ -18,9 +18,16 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class MojangAccount;
|
||||
|
||||
typedef std::shared_ptr<MojangAccount> MojangAccountPtr;
|
||||
Q_DECLARE_METATYPE(MojangAccountPtr)
|
||||
|
||||
|
||||
/**
|
||||
* Class that represents a profile within someone's Mojang account.
|
||||
*
|
||||
@ -71,6 +78,16 @@ public:
|
||||
*/
|
||||
MojangAccount(const MojangAccount& other, QObject* parent);
|
||||
|
||||
/**
|
||||
* Loads a MojangAccount from the given JSON object.
|
||||
*/
|
||||
static MojangAccountPtr loadFromJson(const QJsonObject& json);
|
||||
|
||||
/**
|
||||
* Saves a MojangAccount to a JSON object and returns it.
|
||||
*/
|
||||
QJsonObject saveToJson();
|
||||
|
||||
|
||||
/**
|
||||
* This MojangAccount's username. May be an email address if the account is migrated.
|
||||
@ -130,6 +147,3 @@ protected:
|
||||
ProfileList m_profiles; // List of available profiles.
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<MojangAccount> MojangAccountPtr;
|
||||
Q_DECLARE_METATYPE(MojangAccountPtr)
|
||||
|
||||
|
Reference in New Issue
Block a user