From 525cf4a48bc8da26eeb6d57c142c5a20443a9e87 Mon Sep 17 00:00:00 2001 From: Mirian Margiani Date: Mon, 21 Dec 2020 10:42:53 +0100 Subject: Make sure filenames end with lowercase ".gpg" when moving --- src/imitatepass.cpp | 6 +++--- 1 file 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); -- cgit v1.2.3