Dehardcode account providers (#38)

* Dehardcode account providers

* Fix crash on creation

* Add dynamic 'add account dialog' provider selector

* Fix typo and add newlines

* Rename loginType to provider

* Rename MojangAccount to Account and MojangAccountList to AccountList

* Fix json save error
This commit is contained in:
Max
2021-06-14 12:51:25 +03:00
committed by GitHub
parent 396400b60d
commit 167b6bd405
39 changed files with 398 additions and 261 deletions

View File

@@ -42,7 +42,8 @@
#include "dialogs/CustomMessageBox.h"
#include "InstanceList.h"
#include <minecraft/auth/MojangAccountList.h>
#include <minecraft/auth/AuthProviders.h>
#include <minecraft/auth/AccountList.h>
#include "icons/IconList.h"
#include "net/HttpMetaCache.h"
#include "Env.h"
@@ -683,9 +684,14 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
qDebug() << "<> Instances loaded.";
}
// load auth providers
{
AuthProviders::load();
}
// and accounts
{
m_accounts.reset(new MojangAccountList(this));
m_accounts.reset(new AccountList(this));
qDebug() << "Loading accounts...";
m_accounts->setListFilePath("accounts.json", true);
m_accounts->loadList();