summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-04 00:04:02 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-04 00:04:02 (GMT)
commit13223a903db7f1a7277b4883535d787b553b536e (patch)
tree6c3fd0f987905041480d401a6190ad05c8a6624c
parent23ab7fba0f49413fceb2717b11d016ef768ed174 (diff)
Port away from KTempDir to QTemporaryDir.
-rw-r--r--caff.cpp17
-rw-r--r--caff_p.h4
-rw-r--r--core/convert.cpp8
3 files changed, 15 insertions, 14 deletions
diff --git a/caff.cpp b/caff.cpp
index 323d863..37f8646 100644
--- a/caff.cpp
+++ b/caff.cpp
@@ -27,11 +27,12 @@
#include <KDebug>
#include <KLocale>
-#include <KTempDir>
#include <KToolInvocation>
#include <KMessageBox>
+
#include <QDir>
#include <QFileInfo>
+#include <QTemporaryDir>
KGpgCaffPrivate::KGpgCaffPrivate(KGpgCaff *parent, const KGpgSignableNode::List &ids, const QStringList &signers,
const KGpgCaff::OperationFlags flags, const KGpgSignTransactionHelper::carefulCheck checklevel)
@@ -84,13 +85,13 @@ KGpgCaffPrivate::reexportKey(const KGpgSignableNode *key)
return;
}
- m_tempdir.reset(new KTempDir());
+ m_tempdir.reset(new QTemporaryDir());
if (m_gpgVersion >= 0x20100) {
/* see http://lists.gnupg.org/pipermail/gnupg-devel/2014-December/029296.html */
QFile seclink(m_secringdir);
- if (!seclink.link(m_tempdir->name() + QLatin1String("private-keys-v1.d"))) {
+ if (!seclink.link(m_tempdir->path() + QLatin1String("private-keys-v1.d"))) {
KMessageBox::sorry(qobject_cast<QWidget *>(q->parent()),
i18n("This function is not available on this system. The symbolic link to the private GnuPG keys cannot be created."));
return;
@@ -108,7 +109,7 @@ KGpgCaffPrivate::reexportKey(const KGpgSignableNode *key)
KGpgExport *exp = new KGpgExport(this, exportkeys, expOptions);
exp->setOutputTransaction(imp);
- imp->setGnuPGHome(m_tempdir->name());
+ imp->setGnuPGHome(m_tempdir->path());
connect(imp, SIGNAL(done(int)), SLOT(slotReimportDone(int)));
imp->start();
@@ -126,7 +127,7 @@ KGpgCaffPrivate::slotReimportDone(int result)
abortOperation(-1);
} else {
KGpgSignUid *signuid = new KGpgSignUid(this, m_signers.first(), m_allids.first(), false, m_checklevel);
- signuid->setGnuPGHome(m_tempdir->name());
+ signuid->setGnuPGHome(m_tempdir->path());
if (m_gpgVersion < 0x20100)
signuid->setSecringFile(m_secringfile);
connect(signuid, SIGNAL(done(int)), SLOT(slotSigningFinished(int)));
@@ -268,7 +269,7 @@ KGpgCaffPrivate::slotSigningFinished(int result)
KGpgDelUid *deluid = new KGpgDelUid(this, key, uidnum, removeMode);
- deluid->setGnuPGHome(m_tempdir->name());
+ deluid->setGnuPGHome(m_tempdir->path());
connect(deluid, SIGNAL(done(int)), SLOT(slotDelUidFinished(int)));
@@ -296,7 +297,7 @@ KGpgCaffPrivate::slotDelUidFinished(int result)
KGpgExport *exp = new KGpgExport(this, QStringList(key->getId()), expOptions);
- exp->setGnuPGHome(m_tempdir->name());
+ exp->setGnuPGHome(m_tempdir->path());
connect(exp, SIGNAL(done(int)), SLOT(slotExportFinished(int)));
@@ -329,7 +330,7 @@ KGpgCaffPrivate::slotExportFinished(int result)
// Set the home directory to make sure custom encrypt options
// as well as the "always encrypt to" setting are not honored.
- enc->setGnuPGHome(m_tempdir->name());
+ enc->setGnuPGHome(m_tempdir->path());
connect(enc, SIGNAL(done(int)), SLOT(slotTextEncrypted(int)));
diff --git a/caff_p.h b/caff_p.h
index 4e228fd..da388e1 100644
--- a/caff_p.h
+++ b/caff_p.h
@@ -23,7 +23,7 @@
#include <QString>
#include <QStringList>
-class KTempDir;
+class QTemporaryDir;
class KGpgCaffPrivate : public QObject {
Q_OBJECT
@@ -32,7 +32,7 @@ class KGpgCaffPrivate : public QObject {
Q_DECLARE_PUBLIC(KGpgCaff)
Q_DISABLE_COPY(KGpgCaffPrivate)
- QScopedPointer<KTempDir> m_tempdir;
+ QScopedPointer<QTemporaryDir> m_tempdir;
QStringList m_signers;
QString m_secringfile;
QString m_secringdir; ///< where GnuPG >=2.1 store their secret keyring information
diff --git a/core/convert.cpp b/core/convert.cpp
index 826dd50..7e7a459 100644
--- a/core/convert.cpp
+++ b/core/convert.cpp
@@ -21,7 +21,7 @@
#include "convert.h"
-#include <QDebug>
+#include <KDebug>
#include <gpgme.h>
#include "kgpgsettings.h"
@@ -217,9 +217,9 @@ KgpgSubKeyType toSubType(const QString& capString, bool upper)
case 'D': // disabled key
case '?': // unknown to GnuPG
continue;
-// default:
-// qDebug(2100) << "unknown capability letter" << ch
-// << "in cap string" << capString; // FIXME: KF5
+ default:
+ kDebug(2100) << "unknown capability letter" << ch
+ << "in cap string" << capString;
}
}