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

Explicitly only remove ".gpg" when renaming files #558

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

ichthyosaurus
Copy link
Contributor

@ichthyosaurus ichthyosaurus commented Dec 20, 2020

QFileInfo::baseName removes any path plus the complete suffix. The alternative QFileInfo::completeBaseName would only remove the last suffix (e.g. ".gz" in "foo.tar.gz") but we want to remove ".gpg" only.

Cf. https://doc.qt.io/qt-5/qfileinfo.html#completeBaseName

This fixes part of #520. I could not reproduce the other errors mentioned there ("different-name.gpg" → "different-name.account" and "foobar.com creates a file named foobar.com instead of a file named foobar.com.gpg").

(Only tested on GNU/Linux.)

QFileInfo::baseName removes the path plus the complete suffix. The
alternative QFileInfo::completeBaseName would only remove the last
suffix (e.g. ".gz" in "foo.tar.gz") but we want to remove ".gpg" only.
@annejan
Copy link
Member

annejan commented Dec 21, 2020

Thank you very much for your contribution!

Tested on MacOS and Windows (VM)

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.

2 participants