-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Savedata: Update filelist on file erasure #16239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two nitpicks.
Core/Dialog/SavedataParam.cpp
Outdated
@@ -382,6 +385,40 @@ int SavedataParam::DeleteData(SceUtilitySavedataParam* param) { | |||
ClearCaches(); | |||
pspFileSystem.RemoveFile(filePath); | |||
|
|||
// Update PARAM.SFO to remove the file, if it was ni the list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ni the list/in the list
@@ -382,6 +385,40 @@ int SavedataParam::DeleteData(SceUtilitySavedataParam* param) { | |||
ClearCaches(); | |||
pspFileSystem.RemoveFile(filePath); | |||
|
|||
// Update PARAM.SFO to remove the file, if it was ni the list. | |||
std::shared_ptr<ParamSFOData> sfoFile = LoadCachedSFO(sfoPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a unique_ptr
, right? (less overhead, though hardly matters here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoadCachedSFO()
returns a shared_ptr, because it returns a common pointer from a cache but you can clear its cache, so I just wanted to be safe from any crashes. For example, saving a file loads the SFO data, then clears the SFO cache (because it modifies things.)
It definitely can't be a unique_ptr, because the whole point of LoadCachedSFO()
is to reuse the already loaded SFO data. Would not want it freed on each use.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, yeah, should have gone looking inside LoadCachedSFO.
This is correct, ignore me.
Also stop reporting as "not coded."
62e88ec
to
29e7a53
Compare
Also stop reporting as "not coded."
Basically, this is the reason to use it over just deleting the file directly. Also, per some quick tests, SECURE vs non-SECURE doesn't seem to matter. Both happily delete a file created using WRITEDATASECURE or WRITEDATA, and both update the file list.
-[Unknown]