summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCreak <romain.failliot@foolstep.com>2021-10-15 21:57:25 +0200
committerGitHub <noreply@github.com>2021-10-15 21:57:25 +0200
commitbad122b19594de66e85ab318e934709306001acd (patch)
tree1cc2f5f8032626ffe62cf721341232cb1d2049c6
parentconfig: Read network_interface (diff)
downloadyuzu-bad122b19594de66e85ab318e934709306001acd.tar
yuzu-bad122b19594de66e85ab318e934709306001acd.tar.gz
yuzu-bad122b19594de66e85ab318e934709306001acd.tar.bz2
yuzu-bad122b19594de66e85ab318e934709306001acd.tar.lz
yuzu-bad122b19594de66e85ab318e934709306001acd.tar.xz
yuzu-bad122b19594de66e85ab318e934709306001acd.tar.zst
yuzu-bad122b19594de66e85ab318e934709306001acd.zip
-rw-r--r--src/yuzu/main.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 9f80a245c..d808e9f1d 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2381,15 +2381,13 @@ InstallResult GMainWindow::InstallNCA(const QString& filename) {
static_cast<size_t>(FileSys::TitleType::FirmwarePackageB);
}
- FileSys::InstallResult res;
- if (index >= static_cast<s32>(FileSys::TitleType::Application)) {
- res = system.GetFileSystemController().GetUserNANDContents()->InstallEntry(
- *nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
- } else {
- res = system.GetFileSystemController().GetSystemNANDContents()->InstallEntry(
- *nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
- }
+ const bool is_application = index >= static_cast<s32>(FileSys::TitleType::Application);
+ const auto& fs_controller = system.GetFileSystemController();
+ auto* registered_cache = is_application ? fs_controller.GetUserNANDContents()
+ : fs_controller.GetSystemNANDContents();
+ const auto res = registered_cache->InstallEntry(*nca, static_cast<FileSys::TitleType>(index),
+ true, qt_raw_copy);
if (res == FileSys::InstallResult::Success) {
return InstallResult::Success;
} else if (res == FileSys::InstallResult::OverwriteExisting) {