mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
Qt: fix removal functions after cache compression
This commit is contained in:
parent
ef6f565dbd
commit
096a08aca1
1 changed files with 30 additions and 36 deletions
|
@ -1248,13 +1248,11 @@ bool game_list_frame::RemoveShadersCache(const std::string& base_dir, bool is_in
|
|||
u32 caches_removed = 0;
|
||||
u32 caches_total = 0;
|
||||
|
||||
QDirIterator dir_iter(qstr(base_dir), QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
QDirIterator dir_iter(qstr(base_dir), QStringList() << QStringLiteral("shaders_cache"), QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
while (dir_iter.hasNext())
|
||||
{
|
||||
const QString filepath = dir_iter.next();
|
||||
|
||||
if (dir_iter.fileName() == "shaders_cache")
|
||||
{
|
||||
if (QDir(filepath).removeRecursively())
|
||||
{
|
||||
++caches_removed;
|
||||
|
@ -1264,9 +1262,9 @@ bool game_list_frame::RemoveShadersCache(const std::string& base_dir, bool is_in
|
|||
{
|
||||
LOG_WARNING(GENERAL, "Could not completely remove shaders cache dir: %s", sstr(filepath));
|
||||
}
|
||||
|
||||
++caches_total;
|
||||
}
|
||||
}
|
||||
|
||||
const bool success = caches_total == caches_removed;
|
||||
|
||||
|
@ -1289,13 +1287,11 @@ bool game_list_frame::RemovePPUCache(const std::string& base_dir, bool is_intera
|
|||
u32 files_removed = 0;
|
||||
u32 files_total = 0;
|
||||
|
||||
QDirIterator dir_iter(qstr(base_dir), QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
QDirIterator dir_iter(qstr(base_dir), QStringList() << QStringLiteral("*.obj") << QStringLiteral("*.obj.gz"), QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
while (dir_iter.hasNext())
|
||||
{
|
||||
const QString filepath = dir_iter.next();
|
||||
|
||||
if (QString::compare(dir_iter.fileInfo().suffix(), QStringLiteral("obj"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
if (QFile::remove(filepath))
|
||||
{
|
||||
++files_removed;
|
||||
|
@ -1305,9 +1301,9 @@ bool game_list_frame::RemovePPUCache(const std::string& base_dir, bool is_intera
|
|||
{
|
||||
LOG_WARNING(GENERAL, "Could not remove PPU cache file: %s", sstr(filepath));
|
||||
}
|
||||
|
||||
++files_total;
|
||||
}
|
||||
}
|
||||
|
||||
const bool success = files_total == files_removed;
|
||||
|
||||
|
@ -1330,13 +1326,11 @@ bool game_list_frame::RemoveSPUCache(const std::string& base_dir, bool is_intera
|
|||
u32 files_removed = 0;
|
||||
u32 files_total = 0;
|
||||
|
||||
QDirIterator dir_iter(qstr(base_dir), QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
QDirIterator dir_iter(qstr(base_dir), QStringList() << QStringLiteral("*.dat") << QStringLiteral("*.dat.gz"), QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
||||
while (dir_iter.hasNext())
|
||||
{
|
||||
const QString filepath = dir_iter.next();
|
||||
|
||||
if (QString::compare(dir_iter.fileInfo().suffix(), QStringLiteral("dat"), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
if (QFile::remove(filepath))
|
||||
{
|
||||
++files_removed;
|
||||
|
@ -1346,9 +1340,9 @@ bool game_list_frame::RemoveSPUCache(const std::string& base_dir, bool is_intera
|
|||
{
|
||||
LOG_WARNING(GENERAL, "Could not remove SPU cache file: %s", sstr(filepath));
|
||||
}
|
||||
|
||||
++files_total;
|
||||
}
|
||||
}
|
||||
|
||||
const bool success = files_total == files_removed;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue