Commit 13223a90 authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Port away from KTempDir to QTemporaryDir.

parent 23ab7fba
......@@ -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)));
......
......@@ -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
......
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment