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:
commit
22dfb443a0
10
src/main.cpp
10
src/main.cpp
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user