diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-05-24 16:07:36 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2022-05-25 15:21:44 +0300 |
commit | e81625c9706ac5280fed65f6b8af141963860072 (patch) | |
tree | 9ce22eeb4bc3c88c834921818627c253b0bbdb57 /src/gui/application.cpp | |
parent | 0ae84fad0d718b084dc5bcefc2098ce4f4b8b7a3 (diff) |
Use ocis productversion
Diffstat (limited to 'src/gui/application.cpp')
-rw-r--r-- | src/gui/application.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/gui/application.cpp b/src/gui/application.cpp index fbd5401be..bea9c357d 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -396,21 +396,8 @@ Application::~Application() AccountManager::instance()->shutdown(); } -void Application::slotAccountStateRemoved(AccountStatePtr accountState) const +void Application::slotAccountStateRemoved() const { - if (_gui) { - disconnect(accountState.data(), &AccountState::stateChanged, - _gui.data(), &ownCloudGui::slotAccountStateChanged); - disconnect(accountState->account().data(), &Account::serverVersionChanged, - _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported); - } - if (_folderManager) { - disconnect(accountState.data(), &AccountState::stateChanged, - _folderManager.data(), &FolderMan::slotAccountStateChanged); - disconnect(accountState->account().data(), &Account::serverVersionChanged, - _folderManager.data(), &FolderMan::slotServerVersionChanged); - } - // if there is no more account, show the wizard. if (_gui && AccountManager::instance()->accounts().isEmpty()) { // allow to add a new account if there is non any more. Always think @@ -425,13 +412,17 @@ void Application::slotAccountStateAdded(AccountStatePtr accountState) const connect(accountState.data(), &AccountState::stateChanged, _gui.data(), &ownCloudGui::slotAccountStateChanged); connect(accountState->account().data(), &Account::serverVersionChanged, - _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported); + _gui.data(), [account = accountState->account().data(), this] { + _gui->slotTrayMessageIfServerUnsupported(account); + }); // Hook up the folder manager slots to the account state's signals: connect(accountState.data(), &AccountState::stateChanged, _folderManager.data(), &FolderMan::slotAccountStateChanged); connect(accountState->account().data(), &Account::serverVersionChanged, - _folderManager.data(), &FolderMan::slotServerVersionChanged); + _folderManager.data(), [account = accountState->account().data()] { + FolderMan::instance()->slotServerVersionChanged(account); + }); _gui->slotTrayMessageIfServerUnsupported(accountState->account().data()); } |