Gui: periodically check cache directory and offer a way to clean it up if it exceeds the limit

This commit is contained in:
wmayer
2021-11-15 22:53:41 +01:00
parent d5726bd7af
commit 973642285e
3 changed files with 241 additions and 34 deletions

View File

@@ -2418,7 +2418,15 @@ void Application::setStyleSheet(const QString& qssFile, bool tiledBackground)
void Application::checkForPreviousCrashes()
{
Gui::Dialog::DocumentRecoveryFinder finder;
finder.checkForPreviousCrashes();
if (!finder.checkForPreviousCrashes()) {
// If the recovery dialog wasn't shown check the cache size periodically
Gui::Dialog::ApplicationCache cache;
if (cache.periodicCheckOfSize()) {
qint64 total = cache.size();
cache.performAction(total);
}
}
}
App::Document *Application::reopen(App::Document *doc) {