Allow filename templates to create subdirectories#4687
Conversation
937e26a to
27a93be
Compare
|
Personally, I like the idea of creating date-based subfolders, but the solution needs to be rethought. In my opinion, it should not be allowed to use '/' and '\' in file names at all and the workaround with this special character replacement should be completly removed. flameshot/src/utils/filenamehandler.cpp Line 48 in 95032bd Just my two cents - waiting for further feedback. |
|
Thanks for testing and for the detailed screenshots. I pushed a follow-up that keeps the configured save directory unchanged when the user accepts the generated filename, so date-based subfolders from the filename pattern should not be written back into the save path and nested on later screenshots. I also left the configured path untouched when the save path is fixed. I could only run |
Thank you for trying to take one part of my considerations into account (my first remark is still broken). However, I won't continue with the testing if you make code changes without testing them yourself first! Please run local tests yourself before pushing further commits. |
|
Thanks for the follow-up. I set up the local Qt6 build environment and verified this before pushing another change. The new commit fixes the remaining %m/%D/%y parsing case: when the configured pattern contains an explicit path separator, slashes produced by strftime expansions are also treated as path separators. Patterns without explicit separators keep the previous behavior of replacing strftime slashes with the fraction slash character. Local checks run:
|



Summary
/characters in filename templates as path separators while still sanitizing slashes produced by strftime specifiersFixes #510.
Testing
git diff --checkcmake -S . -B build -DCMAKE_BUILD_TYPE=Debug(fails locally: Qt6 development files are not installed, soQt6Config.cmakeis unavailable)