file_sys/registered_cache: Use regular const references instead of std::shared_ptr for InstallEntry()
These parameters don't need to utilize a shared lifecycle directly in the interface. Instead, the caller should provide a regular reference for the function to use. This also allows the type system to flag attempts to pass nullptr and makes it more generic, since it can now be used in contexts where a shared_ptr isn't being used (in other words, we don't constrain the usage of the interface to a particular mode of memory management).
This commit is contained in:
parent
1cd40f107f
commit
d72c809030
3 changed files with 31 additions and 32 deletions
|
@ -1105,14 +1105,14 @@ void GMainWindow::OnMenuInstallToNAND() {
|
|||
return;
|
||||
}
|
||||
const auto res =
|
||||
Service::FileSystem::GetUserNANDContents()->InstallEntry(nsp, false, qt_raw_copy);
|
||||
Service::FileSystem::GetUserNANDContents()->InstallEntry(*nsp, false, qt_raw_copy);
|
||||
if (res == FileSys::InstallResult::Success) {
|
||||
success();
|
||||
} else {
|
||||
if (res == FileSys::InstallResult::ErrorAlreadyExists) {
|
||||
if (overwrite()) {
|
||||
const auto res2 = Service::FileSystem::GetUserNANDContents()->InstallEntry(
|
||||
nsp, true, qt_raw_copy);
|
||||
*nsp, true, qt_raw_copy);
|
||||
if (res2 == FileSys::InstallResult::Success) {
|
||||
success();
|
||||
} else {
|
||||
|
@ -1167,10 +1167,10 @@ void GMainWindow::OnMenuInstallToNAND() {
|
|||
FileSys::InstallResult res;
|
||||
if (index >= static_cast<size_t>(FileSys::TitleType::Application)) {
|
||||
res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
|
||||
nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
|
||||
*nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
|
||||
} else {
|
||||
res = Service::FileSystem::GetSystemNANDContents()->InstallEntry(
|
||||
nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
|
||||
*nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
|
||||
}
|
||||
|
||||
if (res == FileSys::InstallResult::Success) {
|
||||
|
@ -1178,7 +1178,7 @@ void GMainWindow::OnMenuInstallToNAND() {
|
|||
} else if (res == FileSys::InstallResult::ErrorAlreadyExists) {
|
||||
if (overwrite()) {
|
||||
const auto res2 = Service::FileSystem::GetUserNANDContents()->InstallEntry(
|
||||
nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
|
||||
*nca, static_cast<FileSys::TitleType>(index), true, qt_raw_copy);
|
||||
if (res2 == FileSys::InstallResult::Success) {
|
||||
success();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue