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:
parent
e74e29e4fb
commit
e682dada3b
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user