mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 19:12:28 +02:00
Merge pull request #13905 from zfox23/fixPr13870
Fixup PR13870: Make the feature work in Master
This commit is contained in:
commit
f5ebdfa233
3 changed files with 11 additions and 8 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue