Browse Source

feat(login): generate a GUI error when auto login fails

reviewable/pr5783/r2
jenli669 6 years ago
parent
commit
8832234758
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E
  1. 5
      src/main.cpp

5
src/main.cpp

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include <QMutex>
#include <QMutexLocker>
#include <QtWidgets/QMessageBox>
#include <ctime>
#include <sodium.h>
#include <stdio.h>
@ -343,6 +344,10 @@ int main(int argc, char* argv[]) @@ -343,6 +344,10 @@ int main(int argc, char* argv[])
Profile* profile = nullptr;
if (autoLogin && Profile::exists(profileName) && !Profile::isEncrypted(profileName)) {
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);

Loading…
Cancel
Save