Showing the changes to interface/src/AndroidHelper.cpp (1 of 5 files). Show all
Unified · Split
| @@ -13,7 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <AccountManager.h> |
| 14 | 14 | |
| 15 | 15 | AndroidHelper::AndroidHelper() { |
| 16 | − workerThread.start(); | |
| 17 | 16 | } |
| 18 | 17 | |
| 19 | 18 | AndroidHelper::~AndroidHelper() { |
| @@ -22,7 +21,20 @@ AndroidHelper::~AndroidHelper() { · 2 unmodified lines | ||
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | void AndroidHelper::init() { |
| 25 | − DependencyManager::get<AccountManager>()->moveToThread(&workerThread); | |
| 24 | + workerThread.start(); | |
| 25 | + _accountManager = QSharedPointer<AccountManager>(new AccountManager, &QObject::deleteLater); | |
| 26 | + _accountManager->setIsAgent(true); | |
| 27 | + _accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL()); | |
| 28 | + _accountManager->setSessionID(DependencyManager::get<AccountManager>()->getSessionID()); | |
| 29 | + connect(_accountManager.data(), &AccountManager::loginComplete, [](const QUrl& authURL) { | |
| 30 | + DependencyManager::get<AccountManager>()->setAccountInfo(AndroidHelper::instance().getAccountManager()->getAccountInfo()); | |
| 31 | + DependencyManager::get<AccountManager>()->setAuthURL(authURL); | |
| 32 | + }); | |
| 33 | + | |
| 34 | + connect(_accountManager.data(), &AccountManager::logoutComplete, [] () { | |
| 35 | + DependencyManager::get<AccountManager>()->logout(); | |
| 36 | + }); | |
| 37 | + _accountManager->moveToThread(&workerThread); | |
| 26 | 38 | } |
| 27 | 39 | |
| 28 | 40 | void AndroidHelper::requestActivity(const QString &activityName) { |