From 06e5b6750c290df59e4571e1ee43d9df7c1e740c Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 25 Sep 2015 16:25:42 +0100 Subject: [PATCH] Make Dropbox logout work. --- src/internet/dropbox/dropboxservice.cpp | 4 ++++ src/internet/dropbox/dropboxsettingspage.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/internet/dropbox/dropboxservice.cpp b/src/internet/dropbox/dropboxservice.cpp index cb81f7184..9448c0ee3 100644 --- a/src/internet/dropbox/dropboxservice.cpp +++ b/src/internet/dropbox/dropboxservice.cpp @@ -171,6 +171,10 @@ void DropboxService::RequestFileListFinished(QNetworkReply* reply) { } void DropboxService::LongPollDelta() { + if (!has_credentials()) { + // Might have been signed out by the user. + return; + } QSettings s; s.beginGroup(kSettingsGroup); diff --git a/src/internet/dropbox/dropboxsettingspage.cpp b/src/internet/dropbox/dropboxsettingspage.cpp index 1b0f5aa76..df982c2ad 100644 --- a/src/internet/dropbox/dropboxsettingspage.cpp +++ b/src/internet/dropbox/dropboxsettingspage.cpp @@ -90,6 +90,9 @@ bool DropboxSettingsPage::eventFilter(QObject* object, QEvent* event) { void DropboxSettingsPage::LogoutClicked() { ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedOut); + QSettings s; + s.beginGroup(DropboxService::kSettingsGroup); + s.remove("access_token2"); } void DropboxSettingsPage::Connected() {