Repository navigation
Percent-encode export preset filenames - #1938
Conversation
d026fed to
feede93
Compare
|
The message box and rejection adds friction to the user. How would you feel about performing a substitution instead? For example:
An easy way would be to use https://doc.qt.io/qt-6/qurl.html#toPercentEncoding to create the folder name, and then use https://doc.qt.io/qt-6/qurl.html#fromPercentEncoding to get the original name back. |
feede93 to
21731b8
Compare
21731b8 to
29fe012
Compare
|
Wow! That was fast. Did you also test that this change will continue to work with legacy names? For example, I expect this change will convert "1080 vertical" to "1080%20vertical". If the user has a folder called "1080 vertical", will it still be found after this change? Maybe we want to pass a few exceptions to the encoding function (like space, underscore, and parenthesis) so the folder names are still mostly readable. What do you think? |
if (s == QUrl::toPercentEncoding(QUrl::fromPercentEncoding(s.toUtf8())))
m_presets << QUrl::fromPercentEncoding(s.toUtf8());
else
m_presets << s;The commit message says "fix loading old preset with '%' in the name." |
|
Yes, I checked compatibility with legacy filenames containing spaces, Existing presets retain their original filename in the model for loading and deletion; decoding only affects the displayed name. The patch already includes the same round-trip check used in I suggest keeping the encoding consistent with filter presets. Spaces and parentheses are encoded on disk and displayed normally in the UI. Underscores already remain unescaped. Validation used the actual dialog and a separate Qt harness compiling the custom-preset listing code and delete handler extracted from |
Custom export preset names are used as filenames, so a name such as
H264/1080pcan fail to save.Percent-encode the filename with QUrl and decode it for display. Slash and backslash are accepted without a warning. Keep the stored filename in the model for loading and deletion, preserve category grouping, and use the readable name in the delete confirmation. Recognize unencoded legacy filenames using the same round-trip check as filter presets.
Fixes #1719.
Validation:
git diff --check.Full Shotcut build and manual application checks have not been run.