-
Notifications
You must be signed in to change notification settings - Fork 1.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
Use / path separator on Windows in export dialog #17941
base: master
Are you sure you want to change the base?
Conversation
As per comment just above your changes:
So your change breaks an (improbable, but still possible) case on non-Windows systems with \ in the file/directory name. My suggestion is to guard these changes with But in general it would be nice to be consistent about used on Windows path separator - either use / as all normal operating systems, or stick with more native \ and just accept all the escaping nonsense it comes with. |
Okay, will do.
Hmm yeah, of course I think having native file names is better. But Probably I'm missing something, but why even need to escape So, as said, what I was now thinking about is to have it at least consistent with the startup screen, when there is no file picker used yet. Because then also on Windows it shows forward slashes. I don't think it's perfect solution, but at least (for now) better than I guess it's probably a different discussion :D but I guess to have the application really feel like a nicely integrated application on Windows, it should not expose any "normal operating system" design decisions, which Windows users. |
\ is the escape character, so to prevent it from escaping the next character you have to escape it. In Lua the escape character is % so if I want % I have to use %%. |
Ah okay, I think now I get it. Linux:
On Windows on the other hand:
So I guess for Windows user this export box is highly problematic:
I guess the original problem here is that Darktable seems to store the path as some kind of templating string/expression language, which is also directly used for display, which causes the issue. If the underlying storage is separated from how to display it, it might be easier. But not to rewrite everything, I then suggest to - only on windows - replace all backslashes in the result from the GTK file picker with forward slashes, and after that append any variables templates to it.
|
080b636
to
26af684
Compare
I have now updated the pull request, it should keep the original behaviour on Unix and only adjust the filename on Windows. |
I noticed that the export path on Windows starts with a forward slash, like
Interestingly, after a directory is selected with the file picker, the folder name changes to double backslashes.
I think this is probably really weird on Windows, at least I never ever see this anywhere, and it's also quite hard to type. Instead, I therefore propose to just use the unix slash for the time being. At least I guess it would be an easy fix (probably might on the other hand have some side effects on Unix which i'm not sure about? Maybe need to have some OS specific logic here).
Imho best way would be to properly support backslashes like a normal Windows file path, but a / is nowadays also sometimes used, and Windows supports it without problems, so I guess it would be better than a double backslash.