From: Kevin Ottens Date: Thu, 5 Nov 2020 12:37:25 +0000 (+0100) Subject: Fetch apps when we get connected only X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~74^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=86d240f7b4476b246f7e55ffec3b60a06654fdd8;p=nextcloud-desktop.git Fetch apps when we get connected only This was right now on the check connectivity beat which is too much when you got many users. Be more conservative there and only update the list of apps when the account gets connected. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 58a679031..b2e757448 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -54,6 +54,13 @@ AccountState::AccountState(AccountPtr account) connect(account.data(), &Account::credentialsAsked, this, &AccountState::slotCredentialsAsked); _timeSinceLastETagCheck.invalidate(); + + connect(this, &AccountState::isConnectedChanged, [=]{ + // Get the Apps available on the server if we're now connected. + if (isConnected()) { + fetchNavigationApps(); + } + }); } AccountState::~AccountState() = default; @@ -236,9 +243,6 @@ void AccountState::checkConnectivity() // Use a small authed propfind as a minimal ping when we're // already connected. conValidator->checkAuthentication(); - - // Get the Apps available on the server. - fetchNavigationApps(); } else { // Check the server and then the auth.