Fix logout on second relaunch.

Fixes #7279.
This commit is contained in:
John Preston 2020-02-25 07:58:29 +04:00
parent 6f1c1fd070
commit 6fbd0d7deb
1 changed files with 4 additions and 2 deletions

View File

@ -2896,7 +2896,7 @@ base::flat_set<QString> CollectGoodNames() {
_exportSettingsKey,
_trustedBotsKey
};
auto result = base::flat_set<QString>{ "map0", "map1" };
auto result = base::flat_set<QString>{ "map0", "map1", "maps" };
const auto push = [&](FileKey key) {
if (!key) {
return;
@ -2905,6 +2905,8 @@ base::flat_set<QString> CollectGoodNames() {
result.emplace(name);
name[name.size() - 1] = '1';
result.emplace(name);
name[name.size() - 1] = 's';
result.emplace(name);
};
for (const auto &value : _draftsMap) {
push(value);
@ -5120,7 +5122,7 @@ void ClearManager::onStart() {
if (!QDir(di.filePath()).removeRecursively()) result = false;
} else {
QString path = di.filePath();
if (!path.endsWith(qstr("map0")) && !path.endsWith(qstr("map1"))) {
if (!path.endsWith(qstr("map0")) && !path.endsWith(qstr("map1")) && !path.endsWith(qstr("maps"))) {
if (!QFile::remove(di.filePath())) result = false;
}
}