made auto-deleting cache on close an option

Previously we had no disk management whatsoever, so we cleared the cache on
every close just to prevent clogging up tester disk space. Now that we are
implementing disk management, there are better things to do on close regarding
disk cache. However, some users may still wish for the app to delete the cache
on close, so it's provided as an option.
This commit is contained in:
itsmattkc
2020-01-09 21:00:04 +11:00
parent 9c2c384833
commit 362cb9daef
7 changed files with 48 additions and 27 deletions
+1 -10
View File
@@ -143,20 +143,11 @@ void MainWindow::ProjectOpen(Project* p)
SetDefaultLayout();
}
// FIXME: Test code
#include <QDir>
#include "common/filefunctions.h"
// End test code
void MainWindow::closeEvent(QCloseEvent *e)
{
PanelManager::instance()->DeleteAllPanels();
// FIXME: Test code - We have no cache management and the cache is very much testing only, so we delete it on close
// as to not clog up HDD space
QDir(GetMediaCacheLocation()).removeRecursively();
//QDir(GetMediaIndexLocation()).removeRecursively();
// End test code
QMainWindow::closeEvent(e);
}