summaryrefslogtreecommitdiffstats
path: root/src/realpass.cpp
diff options
context:
space:
mode:
authorSune Vuorela <sune@vuorela.dk>2023-08-21 15:39:44 +0200
committerSune Vuorela <sune@vuorela.dk>2023-08-21 16:22:06 +0200
commitbd1f363d72c71324232e11b2029000fb3bd5876a (patch)
tree58c2944e5237cf0f8a4c6bcd7b309e952495ab71 /src/realpass.cpp
parent1e5a217d6a14f06d699e2af52ef4ec4114bbdba2 (diff)
Clazy cleanup and other minor fixes
- Code is now clazy clean with CLAZY_CHECKS="no-connect-by-name,no-overloaded-signal" - Given the minimum Qt version is 5.10, remove ifdef's for older versions - Some more range based for and related cleanups. - Some include cleanups
Diffstat (limited to 'src/realpass.cpp')
-rw-r--r--src/realpass.cpp9
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";