diff options
author | Andrew <forkk@forkk.net> | 2013-11-18 12:58:03 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-11-18 12:58:03 -0600 |
commit | a9a0b65358b3799746fa9c8e1aa879e0b59ef526 (patch) | |
tree | 9db6881e5409495edefd9f04ab3cca5f82674778 /logic/auth | |
parent | cdca53013990ac85967394529476712e6695bbf9 (diff) | |
download | MultiMC-a9a0b65358b3799746fa9c8e1aa879e0b59ef526.tar MultiMC-a9a0b65358b3799746fa9c8e1aa879e0b59ef526.tar.gz MultiMC-a9a0b65358b3799746fa9c8e1aa879e0b59ef526.tar.lz MultiMC-a9a0b65358b3799746fa9c8e1aa879e0b59ef526.tar.xz MultiMC-a9a0b65358b3799746fa9c8e1aa879e0b59ef526.zip |
Implement loading accounts from list.
Diffstat (limited to 'logic/auth')
-rw-r--r-- | logic/auth/MojangAccount.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/logic/auth/MojangAccount.h b/logic/auth/MojangAccount.h index a38cb8f7..35261d65 100644 --- a/logic/auth/MojangAccount.h +++ b/logic/auth/MojangAccount.h @@ -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) - |