Qt: Don't delete empty achievement images directory

Apparently Windows Defender doesn't like this... this is why I moved
everything out of Documents.
pull/3744/head
Stenzek 2 months ago
parent 01ae8e5630
commit 1f1182f33c
No known key found for this signature in database

@ -907,19 +907,8 @@ void QtHost::ApplyMigrations()
const std::string achievement_icons_directory = Path::Combine(EmuFolders::Cache, "achievement_images");
if (FileSystem::DirectoryExists(achievement_icons_directory.c_str()))
{
Error error;
// If it's empty, just delete it.
if (FileSystem::IsDirectoryEmpty(achievement_icons_directory.c_str()))
{
if (!FileSystem::DeleteDirectory(achievement_icons_directory.c_str(), &error))
{
QMessageBox::critical(nullptr, "Error"_L1,
QString::fromStdString(fmt::format(
"Failed to delete empty achievement icons directory: {}", error.GetDescription())));
}
}
else
if (!FileSystem::IsDirectoryEmpty(achievement_icons_directory.c_str()))
{
QMessageBox mb(
QMessageBox::Question, "DuckStation"_L1,
@ -932,6 +921,7 @@ void QtHost::ApplyMigrations()
mb.setWindowIcon(GetAppIcon());
if (mb.exec() == QMessageBox::Yes)
{
Error error;
if (!FileSystem::RecursiveDeleteDirectory(achievement_icons_directory.c_str(), &error))
{
QMessageBox::critical(nullptr, "Error"_L1,

Loading…
Cancel
Save