diff options
author | Andrew Pilley <anpilley@mycronite.net> | 2024-02-17 21:38:47 +0100 |
---|---|---|
committer | Andrew Pilley <anpilley@mycronite.net> | 2024-02-17 21:38:47 +0100 |
commit | 9eba64adce6d6d4af66d6335ba061e9df810892a (patch) | |
tree | 6da47a105be8271e6d3c9f4d11c877674ceb80a5 /src | |
parent | Merge branch 'yuzu-emu:master' into import-firmware (diff) | |
download | yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar.gz yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar.bz2 yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar.lz yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar.xz yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.tar.zst yuzu-9eba64adce6d6d4af66d6335ba061e9df810892a.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 58e23fc69..d3517b805 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -4187,7 +4187,7 @@ void GMainWindow::OnInstallFirmware() { LOG_INFO(Frontend, "Installing firmware from {}", firmware_source_location.toStdString()); - // Check for a resonable number of .nca files (don't hardcode them, just see if there's some in there. + // Check for a resonable number of .nca files (don't hardcode them, just see if there's some in there.) std::filesystem::path firmware_source_path = firmware_source_location.toStdString(); if (!Common::FS::IsDir(firmware_source_path)) { progress.close(); @@ -4195,7 +4195,6 @@ void GMainWindow::OnInstallFirmware() { } std::vector<std::filesystem::path> out; - const Common::FS::DirEntryCallable callback = [&out](const std::filesystem::directory_entry& entry) { if (entry.path().has_extension() && entry.path().extension() == ".nca") out.emplace_back(entry.path()); @@ -4215,11 +4214,15 @@ void GMainWindow::OnInstallFirmware() { // Locate and erase the content of nand/system/Content/registered/*.nca, if any. auto sysnand_content_vdir = system->GetFileSystemController().GetSystemNANDContentDirectory(); - if (sysnand_content_vdir->CleanSubdirectoryRecursive("registered")) { - LOG_INFO(Frontend, - "Cleaned nand/system/Content/registered folder in preparation for new firmware."); + if (!sysnand_content_vdir->CleanSubdirectoryRecursive("registered")) { + progress.close(); + QMessageBox::critical(this, tr("Firmware install failed"), tr("Failed to delete one or more firmware file.")); + return; } + LOG_INFO(Frontend, + "Cleaned nand/system/Content/registered folder in preparation for new firmware."); + QtProgressCallback(100, 20); auto firmware_vdir = sysnand_content_vdir->GetDirectoryRelative("registered"); @@ -4239,7 +4242,7 @@ void GMainWindow::OnInstallFirmware() { success = false; } - if (QtProgressCallback(100, 20 + (int)(((float)(i) / (float)out.size()) * 70.0))) + if (QtProgressCallback(100, 20 + (int)(((float)(i) / (float)out.size()) * 80.0))) { success = false; cancelled = true; |