mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-28 02:03:35 +00:00
9ba331693f
Sync call to QDir::entryList is a bad idea for the user data folder. Some users reported hanging on startup with 1.25M legacy cache files. Now we enumerate up to 10000 files at once asynchronously and clear.
27 lines
648 B
C++
27 lines
648 B
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#pragma once
|
|
|
|
namespace Storage {
|
|
|
|
using CollectGoodFiles = Fn<void(FnMut<void(base::flat_set<QString>&&)>)>;
|
|
|
|
void ClearLegacyFiles(const QString &base, CollectGoodFiles filter);
|
|
|
|
namespace details {
|
|
|
|
std::vector<QString> CollectFiles(
|
|
const QString &base,
|
|
size_type limit,
|
|
const base::flat_set<QString> &skip);
|
|
|
|
bool RemoveLegacyFile(const QString &path);
|
|
|
|
} // namespace details
|
|
} // namespace Storage
|