diff --git a/UI/auth-oauth.cpp b/UI/auth-oauth.cpp index c19be67bd..d18923d9d 100644 --- a/UI/auth-oauth.cpp +++ b/UI/auth-oauth.cpp @@ -71,12 +71,7 @@ OAuthLogin::OAuthLogin(QWidget *parent, const std::string &url, bool token) #endif } -OAuthLogin::~OAuthLogin() -{ -#ifdef BROWSER_AVAILABLE - delete cefWidget; -#endif -} +OAuthLogin::~OAuthLogin() {} int OAuthLogin::exec() { @@ -88,6 +83,22 @@ int OAuthLogin::exec() return QDialog::Rejected; } +void OAuthLogin::reject() +{ +#ifdef BROWSER_AVAILABLE + delete cefWidget; +#endif + QDialog::reject(); +} + +void OAuthLogin::accept() +{ +#ifdef BROWSER_AVAILABLE + delete cefWidget; +#endif + QDialog::accept(); +} + void OAuthLogin::urlChanged(const QString &url) { std::string uri = get_token ? "access_token=" : "code="; diff --git a/UI/auth-oauth.hpp b/UI/auth-oauth.hpp index b558692b2..364dccdc4 100644 --- a/UI/auth-oauth.hpp +++ b/UI/auth-oauth.hpp @@ -24,6 +24,8 @@ public: inline bool LoadFail() const { return fail; } virtual int exec() override; + virtual void reject() override; + virtual void accept() override; public slots: void urlChanged(const QString &url);