Browse Source

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
pull/1535/head
tux3 10 years ago
parent
commit
e682dada3b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
  1. 7
      src/core/core.cpp

7
src/core/core.cpp

@ -861,6 +861,8 @@ QByteArray Core::loadToxSave(QString path) @@ -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) @@ -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…
Cancel
Save