Show format within filename when exporting file #4389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug Description
The
export_file_window
was displaying only the filename instead of the entire path, leading to confusion for users, especially when including dynamic placeholders such as {tag} in the file path.Cause of the Bug
Within the
ExportFileWindow
class, the methodsetOutputFilename
split the provided path intom_outputPath
andm_outputFilename
, causing the window to display only the filename. Consequently, dynamic placeholders like {tag} were omitted from the displayed path, leading to ambiguity for users.Impact
This behavior caused confusion and made it difficult for users to accurately discern the file's destination, particularly when using dynamic placeholders. It also difficulted clearing dynamic placeholders from the export path, as it is not shown in the window.
Solution
To address this issue, the following changes were implemented:
path_formats
defined infilename_formatter
, modifying its type fromvector
toarray
for improved performance.m_outputPath
andm_outputFilename
, dynamic placeholders such as {tag} are now considered part ofm_outputFilename
and excluded fromm_outputPath
.Example
With the new behavior, let's consider the export path:
/home/user/{tag}/test/{frame}/file.png
.m_outputPath
will be/home/user/
m_outputFilename
will be{tag}/test/{frame}/file.png
Now, the displayed path will include the entire dynamic placeholder structure, providing users with clear visibility of the file's destination and enabling the editing of these parameters.
Future Considerations
Maintainers should be aware of potential implications when modifying path-related functionalities in the future. Additionally, it's essential to maintain consistency in handling dynamic placeholders across the application to avoid similar issues.
Resolves #4059
I acknowledge that my contributions are licensed under the Individual Contributor License Agreement V4.0 ("CLA"), as stated in CLA.md.
I have signed the CLA following the steps provided here.