diff options
author | Mirian Margiani <mixosaurus+ichthyo@pm.me> | 2020-12-21 10:42:53 +0100 |
---|---|---|
committer | Mirian Margiani <mixosaurus+ichthyo@pm.me> | 2020-12-21 10:42:53 +0100 |
commit | 525cf4a48bc8da26eeb6d57c142c5a20443a9e87 (patch) | |
tree | 7d3ecd907782be31939b41c0ef98e59ca0e7d789 | |
parent | 4dc894d809d83ca6fbf1879bfc03da472e5f58db (diff) |
Make sure filenames end with lowercase ".gpg" when moving
-rw-r--r-- | src/imitatepass.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/imitatepass.cpp b/src/imitatepass.cpp index 82be1d91..2140505b 100644 --- a/src/imitatepass.cpp +++ b/src/imitatepass.cpp @@ -366,9 +366,9 @@ void ImitatePass::Move(const QString src, const QString dest, destFile = dest; } - if (!destFile.endsWith(".gpg")) - destFile.append(".gpg"); - + if (destFile.endsWith(".gpg", Qt::CaseInsensitive)) + destFile.chop(4); // make sure suffix is lowercase + destFile.append(".gpg"); } else if (srcFileInfo.isDir()) { if (destFileInfo.isDir()) { destFile = QDir(dest).filePath(srcFileBaseName); |