mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 05:04:19 +01:00
main: Slightly refactor NCA entry installation in InstallNCA (#7181)
* main: Slightly refactor NCA entry installation in InstallNCA Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
This commit is contained in:
parent
851fe91b69
commit
bad122b195
@ -2381,15 +2381,13 @@ InstallResult GMainWindow::InstallNCA(const QString& filename) {
|
|||||||
static_cast<size_t>(FileSys::TitleType::FirmwarePackageB);
|
static_cast<size_t>(FileSys::TitleType::FirmwarePackageB);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSys::InstallResult res;
|
const bool is_application = index >= static_cast<s32>(FileSys::TitleType::Application);
|
||||||
if (index >= static_cast<s32>(FileSys::TitleType::Application)) {
|
const auto& fs_controller = system.GetFileSystemController();
|
||||||
res = system.GetFileSystemController().GetUserNANDContents()->InstallEntry(
|
auto* registered_cache = is_application ? fs_controller.GetUserNANDContents()
|
||||||
*nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
|
: fs_controller.GetSystemNANDContents();
|
||||||
} else {
|
|
||||||
res = system.GetFileSystemController().GetSystemNANDContents()->InstallEntry(
|
|
||||||
*nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const auto res = registered_cache->InstallEntry(*nca, static_cast<FileSys::TitleType>(index),
|
||||||
|
true, qt_raw_copy);
|
||||||
if (res == FileSys::InstallResult::Success) {
|
if (res == FileSys::InstallResult::Success) {
|
||||||
return InstallResult::Success;
|
return InstallResult::Success;
|
||||||
} else if (res == FileSys::InstallResult::OverwriteExisting) {
|
} else if (res == FileSys::InstallResult::OverwriteExisting) {
|
||||||
|
Loading…
Reference in New Issue
Block a user