diff options
Diffstat (limited to 'src/realpass.cpp')
-rw-r--r-- | src/realpass.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/realpass.cpp b/src/realpass.cpp index 321cd3a3..a9af0b6e 100644 --- a/src/realpass.cpp +++ b/src/realpass.cpp @@ -1,5 +1,6 @@ #include "realpass.h" #include "qtpasssettings.h" +#include "util.h" #include <QDir> #include <QFileInfo> @@ -117,10 +118,10 @@ void RealPass::Move(const QString src, const QString dest, const bool force) { // remove the .gpg because pass will not work if (srcFileInfo.isFile() && srcFileInfo.suffix() == "gpg") { - passSrc.replace(QRegularExpression("\\.gpg$"), ""); + passSrc.replace(Util::endsWithGpg(), ""); } if (destFileInfo.isFile() && destFileInfo.suffix() == "gpg") { - passDest.replace(QRegularExpression("\\.gpg$"), ""); + passDest.replace(Util::endsWithGpg(), ""); } QStringList args; @@ -157,10 +158,10 @@ void RealPass::Copy(const QString src, const QString dest, const bool force) { // remove the .gpg because pass will not work if (srcFileInfo.isFile() && srcFileInfo.suffix() == "gpg") { - passSrc.replace(QRegularExpression("\\.gpg$"), ""); + passSrc.replace(Util::endsWithGpg(), ""); } if (destFileInfo.isFile() && destFileInfo.suffix() == "gpg") { - passDest.replace(QRegularExpression("\\.gpg$"), ""); + passDest.replace(Util::endsWithGpg(), ""); } QStringList args; args << "cp"; |