Skip to content
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

Fixed #3330: Allow characters after final dot in filename #3333

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

Aniruddha-Deb
Copy link
Contributor

This PR removes .pdf, .xopp and .xoj extensions (if any) and then appends xopp to the filename, rather than the simple replace_extension that was happening previously (because of which the text after the last dot in the filename was lost, as replace_extension used to replace that text thinking it was the extension).

Old code (in SaveJob::save)

fs::path const filepath = doc->getFilepath();
auto const target = fs::path{filepath}.replace_extension(".xopp");

New code:

fs::path filepath = doc->getFilepath();
Util::clearExtensions(filepath, ".pdf");
auto const target = fs::path{filepath}.concat(".xopp");

@personalizedrefrigerator
Copy link
Contributor

This looks good to me! I can confirm that this fixes #3330.

@LittleHuba
Copy link
Member

Could you check how this behaves with .xoj import/export? I do remember that we already touched this once because it did not work as expected.

@personalizedrefrigerator
Copy link
Contributor

personalizedrefrigerator commented Sep 2, 2021

Could you check how this behaves with .xoj import/export? I do remember that we already touched this once because it did not work as expected.

Just checked: .xoj export/import still works with this change.

@personalizedrefrigerator
Copy link
Contributor

Thank you for your work! I'm merging this in 24 hours unless there are objections.

@personalizedrefrigerator personalizedrefrigerator merged commit d690146 into xournalpp:master Sep 6, 2021
jetSett pushed a commit to jetSett/xournalpp that referenced this pull request Oct 5, 2021
@rolandlo rolandlo mentioned this pull request Feb 12, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request save as: Exercise.5.12 --saves--> Exercise.xopp (silently ignoring all after the first dot)
3 participants