1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #5783

jenli669 (2):
      fix(login): show login screen when autologin fails
      feat(login): generate a GUI error when auto login fails
This commit is contained in:
sudden6 2019-08-13 22:26:21 +02:00
commit 22dfb443a0
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -38,6 +38,7 @@
#include <QMutex> #include <QMutex>
#include <QMutexLocker> #include <QMutexLocker>
#include <QtWidgets/QMessageBox>
#include <ctime> #include <ctime>
#include <sodium.h> #include <sodium.h>
#include <stdio.h> #include <stdio.h>
@ -340,8 +341,15 @@ int main(int argc, char* argv[])
// Autologin // Autologin
// TODO (kriby): Shift responsibility of linking views to model objects from nexus // TODO (kriby): Shift responsibility of linking views to model objects from nexus
// Further: generate view instances separately (loginScreen, mainGUI, audio) // Further: generate view instances separately (loginScreen, mainGUI, audio)
Profile* profile = nullptr;
if (autoLogin && Profile::exists(profileName) && !Profile::isEncrypted(profileName)) { if (autoLogin && Profile::exists(profileName) && !Profile::isEncrypted(profileName)) {
Profile* profile = Profile::loadProfile(profileName, QString(), settings); profile = Profile::loadProfile(profileName, QString(), settings);
if (!profile) {
QMessageBox::information(nullptr, QObject::tr("Error"),
QObject::tr("Failed to load profile automatically."));
}
}
if (profile) {
settings.updateProfileData(profile); settings.updateProfileData(profile);
nexus.bootstrapWithProfile(profile); nexus.bootstrapWithProfile(profile);
} else { } else {