Skip to content

Comments

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

Merged
annejan merged 1 commit intoIJHack:masterfrom
ichthyosaurus:fix-520
Dec 21, 2020
Merged

Explicitly only remove ".gpg" when renaming files#558
annejan merged 1 commit intoIJHack:masterfrom
ichthyosaurus:fix-520

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