Merge pull request #13905 from zfox23/fixPr13870

Fixup PR13870: Make the feature work in Master
This commit is contained in:
John Conklin II 2018-08-30 11:08:23 -07:00 committed by GitHub
commit f5ebdfa233
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View file

@ -1760,11 +1760,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
QTimer* settingsTimer = new QTimer();
moveToNewNamedThread(settingsTimer, "Settings Thread", [this, settingsTimer]{
connect(qApp, &Application::beforeAboutToQuit, [this, settingsTimer]{
bool autoLogout = Setting::Handle<bool>(AUTO_LOGOUT_SETTING_NAME, false).get();
if (autoLogout) {
auto accountManager = DependencyManager::get<AccountManager>();
accountManager->logout();
}
// Disconnect the signal from the save settings
QObject::disconnect(settingsTimer, &QTimer::timeout, this, &Application::saveSettings);
// Stop the settings timer
@ -2516,6 +2511,11 @@ void Application::cleanupBeforeQuit() {
}
DependencyManager::destroy<ScriptEngines>();
bool autoLogout = Setting::Handle<bool>(AUTO_LOGOUT_SETTING_NAME, false).get();
if (autoLogout) {
DependencyManager::get<AccountManager>()->removeAccountFromFile();
}
_displayPlugin.reset();
PluginManager::getInstance()->shutdown();

View file

@ -96,6 +96,8 @@ public:
QUrl getMetaverseServerURL() { return NetworkingConstants::METAVERSE_SERVER_URL(); }
void removeAccountFromFile();
public slots:
void requestAccessToken(const QString& login, const QString& password);
void requestAccessTokenWithSteam(QByteArray authSessionTicket);
@ -133,7 +135,6 @@ private:
void operator=(AccountManager const& other) = delete;
void persistAccountToFile();
void removeAccountFromFile();
void passSuccessToCallback(QNetworkReply* reply);
void passErrorToCallback(QNetworkReply* reply);

View file

@ -407,8 +407,10 @@
}
function onUsernameChanged() {
Settings.setValue("wallet/autoLogout", false);
Settings.setValue("wallet/savedUsername", "");
if (Account.username !== Settings.getValue("wallet/savedUsername")) {
Settings.setValue("wallet/autoLogout", false);
Settings.setValue("wallet/savedUsername", "");
}
}
// Function Name: fromQml()