-
Notifications
You must be signed in to change notification settings - Fork 36
Fix Save As #217
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
Fix Save As #217
Conversation
Save as now discards unsaved changes to current project Unsaved changes only written to project under new name Adds filesystem function Delete(Path&) Adds optional argument to PersistencyService::Save(const char* name) Save temp file Copy temp file to new location Delete temp file Bump CHANGELOG #212
danpicton
left a comment
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.
Not sure if this is helpful, so feel free to ignore!
|
|
||
| Path path_srclgptdatsav = path_srcprjdir.GetPath() + "lgptsav.dat"; | ||
| Path path_dstlgptdatsav = path_dstprjdir.GetPath() + "/lgptsav.dat"; | ||
| Path path_srclgptdatsav = path_srcprjdir.GetPath() + "lgptsav_tmp.dat"; |
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.
I can see this is similar to what was there previously, but are we good with the inconsistency between the two filenames (i.e. one is prefixed with /, the other isn't)?
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.
Yes this is required as the srcprj variable is fetched using project: which returns a trailing front slash :)
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.
Cool, thanks for clarifying :)
|
@djdiskmachine - I've built for x64. When I try and "Save Song As", then when selecting a random name or creating a new name, LGPT crashes with this error: The save is unsuccessful. Standard "Save Song" functionality is unaffected. |
|
How strange I've only tried it in the psp emulator, I'll have another look at it then :) |
|
I made a test build yesterday, you can download these here save_as_fixed.mov |
|
.. And for the build created by this latest check run save_as_fixed-1-6-0-bacon1.mov |
|
So i've tried on my ubuntu machine too built on this branch, can't recreate the issue Can you recreate it again then send me the lgpt.log file? |
|
Hmm - strange. Just tried your test build and getting exactly the same issue. I've got AMD Ryzen 7 5700G CPU running Arch with kernel 6.17.6-arch1-1. I've tested the RG35XXPLUS build and that's working fine 🤷♂️ Please let me know if there's any other info that may be helpful! |
|
I couldn't find |
|
debug.patch OK I can see it crashes immediately when you press your A button (Z) on the keyboard Probably need to add more logging in the troublesome parts to figure out why. Can you run with the attached patch file applied? Looks like you have some special kind of setup for your config, i.e. songs and samplelib in another location than your lgpt binary? |
|
Here's an lgpt.log of the behaviour after applying the patch. Here're my config.xml and mapping.xml. The failure persists even if I remove the custom ROOTFOLDER and SAMPLELIB config. |
|
@djdiskmachine I've been doing some more debugging, and this seems to do the job for my x64 build: I used Gemini, but the change makes sense. Possibly it is something to do with my non-default directory setup, even though my testing didn't surface anything. I don't think it would, but hopefully it doesn't break any of the other builds 🤞 |
|
Interesting. So this Is caused by an uninitialized path string then. With this fix, if the path is null we don't set it to the root of the file system which is probably a good guard.. but what does the "" path become then? |
|
Seems like I caused a regression with this PR #215 Your fix is good for other stuff tho. and currentPath for some unexpected reason becomes ""
which is a whole lot less dangerous than allowing
Thanks a lot for all the help I'll add both these fixes :) |
Call ACTION_SAVE_AS NewProjectDialog with "root:" as path Change default currentPath to "root:" (fix regression caused in #215 Disallow accidental root folder access in FileSystem::Descend
|
yw man - happy to help. Thank you, too! 🙌 |
|
lgpt.x64.txt |
|
That seem to have done the trick! 🎉 |
danpicton
left a comment
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.
Looks good ✔️
Save as now discards unsaved changes to current project Unsaved changes only written to project under new name Adds filesystem function Delete(Path&)
Adds optional argument to PersistencyService::Save(const char* name)
Save temp file
Copy temp file to new location
Delete temp file
Bump CHANGELOG
#212
Type of change
Fixes [BUG] - Using "Save Song As" saves to current as well as new project #212
Bug fix (non-breaking change which fixes an issue)
Test Configuration:
Checklist:
sources/Application/Model/Project.h