diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-08-05 10:19:34 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-08-05 18:15:13 +0300 |
commit | c780e455af2700b9c8018bcb68500c19753757ef (patch) | |
tree | 4665b85b03c6cb07dfdd1d21fcc30fe53edaa3fc /src/gui/creds | |
parent | bb2d7b98a452f1e660986d04367d49ec4aa240e9 (diff) |
Fix the 'Re-open Browser' button becoming unresponsive
Diffstat (limited to 'src/gui/creds')
-rw-r--r-- | src/gui/creds/httpcredentialsgui.cpp | 13 | ||||
-rw-r--r-- | src/gui/creds/httpcredentialsgui.h | 8 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index a27046493..64c62d7b6 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -36,6 +36,19 @@ namespace OCC { Q_LOGGING_CATEGORY(lcHttpCredentialsGui, "sync.credentials.http.gui", QtInfoMsg) +void HttpCredentialsGui::openBrowser() +{ + OC_ASSERT(isUsingOAuth()); + if (isUsingOAuth()) { + if (_asyncAuth) { + _asyncAuth->openBrowser(); + } else { + qCWarning(lcHttpCredentialsGui) << "There is no running auth run, did the previous attempt fail?"; + askFromUserAsync(); + } + } +} + void HttpCredentialsGui::askFromUser() { // This function can be called from AccountState::slotInvalidCredentials, diff --git a/src/gui/creds/httpcredentialsgui.h b/src/gui/creds/httpcredentialsgui.h index 18231f165..4c84de8d2 100644 --- a/src/gui/creds/httpcredentialsgui.h +++ b/src/gui/creds/httpcredentialsgui.h @@ -44,13 +44,7 @@ public: _refreshToken = refreshToken; } - void openBrowser() - { - if (isUsingOAuth() && _asyncAuth) - { - _asyncAuth->openBrowser(); - } - } + void openBrowser(); /** * This will query the server and either uses OAuth via _asyncAuth->start() * or call showDialog to ask the password |