-
-
Notifications
You must be signed in to change notification settings - Fork 993
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
Only filter out <>:"/\|?* while exporting tracks. #5282
Conversation
This looks good to me. Technically it misses a few illegal names on Windows, but they weren't covered before either, aside from ending a filename with a period. Out of scope for this PR, but it feels like a bad idea to handle this in these classes. Really, all file writing should delegate to a single method that cleans the filename. That would ensure consistent behavior and make sure every fix (like this) applies to every file we save. Plus, it could be a bit larger (to handle Windows's reserved names and OS differences better) without taking up space in the classes that use it. |
Oh, but I don't feel like the INSTALL.txt changes belong in this. I've seen a lot of activity around fixing CI recently so this fix may already be applied or made redundant in some other PR? |
I see INSTALL.txt in master does mention submodules. It doesn't mention that cmake can mysteriously fail to generate a Makefile without them, though. Anyway, dropping the INSTALL.txt commit would be fine. |
Rebased on latest stable-1.2, and dropped the INSTALL.txt commit… |
Is it safe to be merged? |
It seems like there are some file systems which support limited sets of characters. Should we take care of them? |
2874ade
to
5c799ec
Compare
Now also filters 0x00-0x1F and 0x7F. I hope that covers any semi-serious filesystems there that aren't EBCDIC or with a 16-or-less character limit. |
In most cases, we append the file extension at the end. A trailing period is equivalent to the empty file extension(NOT a file without extensions). |
It's a global common string (in the last version of the commit), so there shouldn't be anyone changing it in one place but not the other. I don't think there should be any files written without an extension added, so I don't think checking for trailing dots is needed (although it could be added if needed). |
If we save directories, it may be valuable, but it still seems like a seldom case. |
What were your reasons to choose that filter? E.g.:
|
@JohannesLorenz The filter reflects restricted characters in major OSes/file systems. |
OK, then I consider functional and style reviews done. Testing remains. |
I just tested to save a file
Can you please check what happens in your local copy? |
Same here, but I think it's unrelated to the commit. The If naming the track |
I checked the regular expression, but I couldn't find any issues with it. I could also confirm the issue with the file dialog, using Qt creator. |
Right, if you don't use I'll merge, thanks for the contribution! |
This now preserves most characters in exported track names.