Showing the changes to interface/src/AndroidHelper.cpp (1 of 3 files). Show all
Unified · Split
| @@ -22,9 +22,21 @@ AndroidHelper::~AndroidHelper() { · 21 unmodified lines | ||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | void AndroidHelper::init() { |
| 25 | − qDebug() << "[LOGIN] AndroidHelper::init"; | |
| 26 | 25 | workerThread.start(); |
| 27 | − _accountManager = DependencyManager::get<AccountManager>(); | |
| 26 | + _accountManager = QSharedPointer<AccountManager>(new AccountManager, &QObject::deleteLater); | |
| 27 | + _accountManager->setIsAgent(true); | |
| 28 | + _accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL()); | |
| 29 | + _accountManager->setSessionID(DependencyManager::get<AccountManager>()->getSessionID()); | |
| 30 | + | |
| 31 | + connect(_accountManager.data(), &AccountManager::loginComplete, [](const QUrl& authURL) { | |
| 32 | + DependencyManager::get<AccountManager>()->setAccountInfo(AndroidHelper::instance().getAccountManager()->getAccountInfo()); | |
| 33 | + DependencyManager::get<AccountManager>()->setAuthURL(authURL); | |
| 34 | + }); | |
| 35 | + | |
| 36 | + connect(_accountManager.data(), &AccountManager::logoutComplete, [] () { | |
| 37 | + DependencyManager::get<AccountManager>()->logout(); | |
| 38 | + }); | |
| 39 | + | |
| 28 | 40 | _accountManager->moveToThread(&workerThread); |
| 29 | 41 | } |
| 30 | 42 | |