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

View File

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