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

Fix save corruption bug

Don't just let the user close the profile select box and continue with an empty value. We would create a new profile and save it back on top of the previous encrypted profile
This commit is contained in:
tux3 2015-04-25 20:20:53 +02:00
parent e74e29e4fb
commit e682dada3b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -861,6 +861,8 @@ QByteArray Core::loadToxSave(QString path)
tr("Your profile is already used by another qTox\n"
"Please select another profile"));
path = Settings::getInstance().askProfiles();
if (path.isEmpty())
continue;
Settings::getInstance().switchProfile(QFileInfo(path).baseName());
HistoryKeeper::resetInstance();
}
@ -890,7 +892,10 @@ QByteArray Core::loadToxSave(QString path)
{
configurationFile.close();
QString profile = Settings::getInstance().askProfiles();
QString profile;
do {
profile = Settings::getInstance().askProfiles();
} while (profile.isEmpty());
if (!profile.isEmpty())
{