Showing the changes to interface/src/scripting/GlobalServicesScriptingInterface.cpp (1 of 21 files). Show all
Unified · Split
| @@ -17,10 +17,10 @@ · 16 unmodified lines | |||
| 17 | #include "GlobalServicesScriptingInterface.h" | 17 | #include "GlobalServicesScriptingInterface.h" |
| 18 | 18 | ||
| 19 | GlobalServicesScriptingInterface::GlobalServicesScriptingInterface() { | 19 | GlobalServicesScriptingInterface::GlobalServicesScriptingInterface() { |
| 20 | AccountManager& accountManager = AccountManager::getInstance(); | 20 | auto accountManager = DependencyManager::get<AccountManager>(); |
| 21 | connect(&accountManager, &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged); | 21 | connect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged); |
| 22 | connect(&accountManager, &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut); | 22 | connect(accountManager.data(), &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut); |
| 23 | connect(&accountManager, &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected); | 23 | connect(accountManager.data(), &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected); |
| 24 | 24 | ||
| 25 | _downloading = false; | 25 | _downloading = false; |
| 26 | QTimer* checkDownloadTimer = new QTimer(this); | 26 | QTimer* checkDownloadTimer = new QTimer(this); |
| @@ -34,10 +34,10 @@ GlobalServicesScriptingInterface::GlobalServicesScriptingInterface() { · 7 unmodified lines | |||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | GlobalServicesScriptingInterface::~GlobalServicesScriptingInterface() { | 36 | GlobalServicesScriptingInterface::~GlobalServicesScriptingInterface() { |
| 37 | AccountManager& accountManager = AccountManager::getInstance(); | 37 | auto accountManager = DependencyManager::get<AccountManager>(); |
| 38 | disconnect(&accountManager, &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged); | 38 | disconnect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged); |
| 39 | disconnect(&accountManager, &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut); | 39 | disconnect(accountManager.data(), &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut); |
| 40 | disconnect(&accountManager, &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected); | 40 | disconnect(accountManager.data(), &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | GlobalServicesScriptingInterface* GlobalServicesScriptingInterface::getInstance() { | 43 | GlobalServicesScriptingInterface* GlobalServicesScriptingInterface::getInstance() { |
| @@ -46,7 +46,7 @@ GlobalServicesScriptingInterface* GlobalServicesScriptingInterface::getInstance( · 2 unmodified lines | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | const QString& GlobalServicesScriptingInterface::getUsername() const { | 48 | const QString& GlobalServicesScriptingInterface::getUsername() const { |
| 49 | return AccountManager::getInstance().getAccountInfo().getUsername(); | 49 | return DependencyManager::get<AccountManager>()->getAccountInfo().getUsername(); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void GlobalServicesScriptingInterface::loggedOut() { | 52 | void GlobalServicesScriptingInterface::loggedOut() { |