aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/qt/src/util.cpp')
-rw-r--r--lang/qt/src/util.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/qt/src/util.cpp b/lang/qt/src/util.cpp
index d4190eb8..a9a70290 100644
--- a/lang/qt/src/util.cpp
+++ b/lang/qt/src/util.cpp
@@ -37,6 +37,10 @@
#include "util.h"
+#include "qgpgme_debug.h"
+
+#include <QFile>
+
#include <key.h>
#include <algorithm>
@@ -61,3 +65,14 @@ QStringList toFingerprints(const std::vector<GpgME::Key> &keys)
});
return fprs;
}
+
+void removeFile(const QString &fileName)
+{
+ if (QFile::exists(fileName)) {
+ if (QFile::remove(fileName)) {
+ qCDebug(QGPGME_LOG) << __func__ << "- Removed file" << fileName;
+ } else {
+ qCDebug(QGPGME_LOG) << __func__ << "- Removing file" << fileName << "failed";
+ }
+ }
+}