Commit 9dac631a authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Rebase on master and port additional classes

parent 009db62c
......@@ -19,7 +19,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(PIM_VERSION "5.3.45")
set(PIM_VERSION "5.3.46")
set(LIBKLEO_LIB_VERSION ${PIM_VERSION})
set(QT_REQUIRED_VERSION "5.6.0")
set(KDEPIMTEXTEDIT_VERSION "5.3.40")
......@@ -36,7 +36,8 @@ find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KDEPIMTEXTEDIT_VERSION} CONFIG)
find_package(Gpgmepp 1.7.0)
set(GPGMEPP_LIB_VERSION "1.7.1")
find_package(Gpgmepp ${GPGMEPP_LIB_VERSION})
set_package_properties(Gpgmepp PROPERTIES DESCRIPTION "GpgME++ Library" URL "http://www.gnupg.org" TYPE REQUIRED PURPOSE "GpgME++ is required for OpenPGP support")
find_package(Boost 1.34.0)
......
@PACKAGE_INIT@
find_dependency(KF5Gpgmepp "@GPGMEPP_LIB_VERSION@")
find_dependency(Gpgmepp "@GPGMEPP_LIB_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/KF5LibkleoTargets.cmake")
......@@ -22,9 +22,11 @@ endif()
########### next target ###############
set(libkleo_core_SRCS
kleo/checksumdefinition.cpp
kleo/defaultkeyfilter.cpp
kleo/defaultkeygenerationjob.cpp
kleo/dn.cpp
kleo/enum.cpp
kleo/exception.cpp
kleo/dn.cpp
kleo/kconfigbasedkeyfilter.cpp
kleo/keyfiltermanager.cpp
models/keycache.cpp
......@@ -36,7 +38,7 @@ set(libkleo_core_SRCS
models/useridlistmodel.cpp
utils/filesystemwatcher.cpp
utils/formatting.cpp
utils/classify
utils/classify.cpp
)
ecm_qt_declare_logging_category(libkleo_core_SRCS HEADER libkleo_debug.h IDENTIFIER LIBKLEO_LOG CATEGORY_NAME org.kde.pim.libkleo)
......@@ -75,7 +77,9 @@ set(kleo_LIB_LIBS PUBLIC QGpgme Gpgmepp PRIVATE Qt5::Widgets
KF5::ConfigCore
KF5::CoreAddons
KF5::WindowSystem
KF5::WidgetsAddons)
KF5::WidgetsAddons
KF5::ItemModels
KF5::Codecs)
if (KF5PimTextEdit_FOUND)
add_definitions(-DHAVE_PIMTEXTEDIT)
......@@ -109,15 +113,18 @@ target_include_directories(KF5Libkleo INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTA
ecm_generate_headers(libkleo_CamelCase_HEADERS
HEADER_NAMES
Enum
Stl_Util
ChecksumDefinition
DefaultKeyFilter
DefaultKeyGenerationJob
Dn
Enum
Exception
KConfigBasedKeyFilter
KeyFilter
ChecksumDefinition
KeyFilterManager
OidMap
Predicates
Stl_Util
REQUIRED_HEADERS libkleo_HEADERS
PREFIX Libkleo
RELATIVE kleo
......
/*
qgpgmekeyformailboxjob.cpp
This file is part of libkleopatra, the KDE keymanagement library
Copyright (c) 2016 Intevation GmbH
Libkleopatra is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
Libkleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#include "qgpgmekeyformailboxjob.h"
#include "qgpgmekeylistjob.h"
using namespace Kleo;
using namespace GpgME;
using namespace boost;
QGpgMEKeyForMailboxJob::QGpgMEKeyForMailboxJob(Context *context)
: mixin_type(context)
{
lateInitialization();
}
QGpgMEKeyForMailboxJob::~QGpgMEKeyForMailboxJob() {}
static bool keyIsOk(const Key k)
{
return !k.isExpired() && !k.isRevoked() && !k.isInvalid() && !k.isDisabled();
}
static bool uidIsOk(const UserID uid)
{
return keyIsOk(uid.parent()) && !uid.isRevoked() && !uid.isInvalid();
}
static bool subkeyIsOk(const Subkey s)
{
return !s.isRevoked() && !s.isInvalid() && !s.isDisabled();
}
static QGpgMEKeyForMailboxJob::result_type do_work(Context *ctx, const QString &mailbox, bool canEncrypt)
{
/* Do a Keylisting. */
ctx->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate);
std::vector<Key> keys;
QGpgMEKeyListJob *keylist = new QGpgMEKeyListJob(ctx);
KeyListResult result = keylist->exec(QStringList() << mailbox, false, keys);
if (result.error()) {
return make_tuple(result, Key(), UserID(), QString(), Error());
}
// This should ideally be decided by GnuPG and this Job changed
// to just call the according API in GpgME
// See: https://bugs.gnupg.org/gnupg/issue2359
Key keyC;
UserID uidC;
Q_FOREACH (const Key k, keys) {
if (canEncrypt && !k.canEncrypt()) {
continue;
}
/* First get the uid that matches the mailbox */
Q_FOREACH (const UserID u, k.userIDs()) {
if (QString::fromUtf8(u.email()).toLower() == mailbox.toLower()) {
if (uidC.isNull()) {
keyC = k;
uidC = u;
} else if ((!uidIsOk(uidC) && uidIsOk(u)) || uidC.validity() < u.validity()) {
/* Validity of the new key is better. */
uidC = u;
keyC = k;
} else if (uidC.validity() == u.validity() && uidIsOk(u)) {
/* Both are the same check which one is newer. */
time_t oldTime = 0;
Q_FOREACH (const Subkey s, keyC.subkeys()) {
if ((canEncrypt && s.canEncrypt()) && subkeyIsOk(s)) {
oldTime = s.creationTime();
}
}
time_t newTime = 0;
Q_FOREACH (const Subkey s, k.subkeys()) {
if ((canEncrypt && s.canEncrypt()) && subkeyIsOk(s)) {
newTime = s.creationTime();
}
}
if (newTime > oldTime) {
uidC = u;
keyC = k;
}
}
}
}
}
return make_tuple(result, keyC, uidC, QString(), Error());
}
Error QGpgMEKeyForMailboxJob::start(const QString &mailbox, bool canEncrypt)
{
run(bind(&do_work, _1, mailbox, canEncrypt));
return Error();
}
KeyListResult QGpgMEKeyForMailboxJob::exec(const QString &mailbox, bool canEncrypt, Key &key, UserID &uid)
{
const result_type r = do_work(context(), mailbox, canEncrypt);
resultHook(r);
key = get<1>(r);
uid = get<2>(r);
return get<0>(r);
}
/*
qgpgmekeyformailboxjob.h
This file is part of libkleopatra, the KDE keymanagement library
Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
Libkleopatra is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
Libkleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef __KLEO_QGPGMEKEYFORMAILBOXJOB_H__
#define __KLEO_QGPGMEKEYFORMAILBOXJOB_H__
#include "libkleo/keyformailboxjob.h"
#include "threadedjobmixin.h"
#include <gpgme++/keylistresult.h>
#include <gpgme++/key.h>
namespace Kleo
{
class QGpgMEKeyForMailboxJob
#ifdef Q_MOC_RUN
: public KeyForMailboxJob
#else
: public _detail::ThreadedJobMixin<KeyForMailboxJob, boost::tuple<GpgME::KeyListResult, GpgME::Key, GpgME::UserID, QString, GpgME::Error> >
#endif
{
Q_OBJECT
#ifdef Q_MOC_RUN
public Q_SLOTS:
void slotFinished();
#endif
public:
explicit QGpgMEKeyForMailboxJob(GpgME::Context *context);
~QGpgMEKeyForMailboxJob();
/**
Starts the operation. \a mailbox is the mailbox to
look for.
The result is the same as for the LocateKeysJob.
If \a canEncrypt is true, only keys that have a subkey for encryption
usage are returned. Use this if you need to select a
key for signing.
*/
GpgME::Error start(const QString &mailbox, bool canEncrypt = true) Q_DECL_OVERRIDE;
GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) Q_DECL_OVERRIDE;
};
}
#endif
......@@ -51,7 +51,6 @@
#include <QCoreApplication>
#include <QRegularExpression>
#include <boost/shared_ptr.hpp>
#include <KSharedConfig>
#include <QStandardPaths>
......@@ -60,7 +59,6 @@
#endif
using namespace Kleo;
using namespace boost;
static QMutex installPathMutex;
Q_GLOBAL_STATIC(QString, _installPath)
......@@ -139,9 +137,9 @@ static QString try_extensions(const QString &path)
static void parse_command(QString cmdline, const QString &id, const QString &whichCommand,
QString *command, QStringList *prefix, QStringList *suffix, ChecksumDefinition::ArgumentPassingMethod *method)
{
assert(prefix);
assert(suffix);
assert(method);
Q_ASSERT(prefix);
Q_ASSERT(suffix);
Q_ASSERT(method);
KShell::Errors errors;
QStringList l;
......@@ -203,7 +201,7 @@ static void parse_command(QString cmdline, const QString &id, const QString &whi
qCDebug(LIBKLEO_LOG) << "ChecksumDefinition[" << id << ']' << "find -print0 | " << *command << *prefix;
break;
case ChecksumDefinition::NumArgumentPassingMethods:
assert(!"Should not happen");
Q_ASSERT(!"Should not happen");
break;
}
}
......@@ -325,7 +323,7 @@ static bool start_command(QProcess *p, const char *functionName,
switch (method) {
case ChecksumDefinition::NumArgumentPassingMethods:
assert(!"Should not happen");
Q_ASSERT(!"Should not happen");
case ChecksumDefinition::CommandLine:
qCDebug(LIBKLEO_LOG) << "Starting: " << cmd << " " << args.join(QStringLiteral(" "));
......@@ -373,22 +371,22 @@ bool ChecksumDefinition::startVerifyCommand(QProcess *p, const QStringList &file
}
// static
std::vector< shared_ptr<ChecksumDefinition> > ChecksumDefinition::getChecksumDefinitions()
std::vector< std::shared_ptr<ChecksumDefinition> > ChecksumDefinition::getChecksumDefinitions()
{
QStringList errors;
return getChecksumDefinitions(errors);
}
// static
std::vector< shared_ptr<ChecksumDefinition> > ChecksumDefinition::getChecksumDefinitions(QStringList &errors)
std::vector< std::shared_ptr<ChecksumDefinition> > ChecksumDefinition::getChecksumDefinitions(QStringList &errors)
{
std::vector< shared_ptr<ChecksumDefinition> > result;
std::vector< std::shared_ptr<ChecksumDefinition> > result;
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("libkleopatrarc"));
const QStringList groups = config->groupList().filter(QRegularExpression(QStringLiteral("^Checksum Definition #")));
result.reserve(groups.size());
Q_FOREACH (const QString &group, groups)
try {
const shared_ptr<ChecksumDefinition> ad(new KConfigBasedChecksumDefinition(KConfigGroup(config, group)));
const std::shared_ptr<ChecksumDefinition> ad(new KConfigBasedChecksumDefinition(KConfigGroup(config, group)));
result.push_back(ad);
} catch (const std::exception &e) {
qDebug() << e.what();
......@@ -400,24 +398,24 @@ std::vector< shared_ptr<ChecksumDefinition> > ChecksumDefinition::getChecksumDef
}
// static
shared_ptr<ChecksumDefinition> ChecksumDefinition::getDefaultChecksumDefinition(const std::vector< shared_ptr<ChecksumDefinition> > &checksumDefinitions)
std::shared_ptr<ChecksumDefinition> ChecksumDefinition::getDefaultChecksumDefinition(const std::vector< std::shared_ptr<ChecksumDefinition> > &checksumDefinitions)
{
const KConfigGroup group(KSharedConfig::openConfig(), "ChecksumOperations");
const QString checksumDefinitionId = group.readEntry(CHECKSUM_DEFINITION_ID_ENTRY);
if (!checksumDefinitionId.isEmpty())
Q_FOREACH (const shared_ptr<ChecksumDefinition> &cd, checksumDefinitions)
Q_FOREACH (const std::shared_ptr<ChecksumDefinition> &cd, checksumDefinitions)
if (cd && cd->id() == checksumDefinitionId) {
return cd;
}
if (!checksumDefinitions.empty()) {
return checksumDefinitions.front();
} else {
return shared_ptr<ChecksumDefinition>();
return std::shared_ptr<ChecksumDefinition>();
}
}
// static
void ChecksumDefinition::setDefaultChecksumDefinition(const shared_ptr<ChecksumDefinition> &checksumDefinition)
void ChecksumDefinition::setDefaultChecksumDefinition(const std::shared_ptr<ChecksumDefinition> &checksumDefinition)
{
if (!checksumDefinition) {
return;
......
......@@ -38,15 +38,11 @@
#include <QString>
#include <QStringList>
#include <memory>
#include <vector>
class QProcess;
namespace boost
{
template <typename T> class shared_ptr;
}
namespace Kleo
{
......@@ -101,11 +97,11 @@ public:
static QString installPath();
static void setInstallPath(const QString &ip);
static std::vector< boost::shared_ptr<ChecksumDefinition> > getChecksumDefinitions();
static std::vector< boost::shared_ptr<ChecksumDefinition> > getChecksumDefinitions(QStringList &errors);
static std::vector< std::shared_ptr<ChecksumDefinition> > getChecksumDefinitions();
static std::vector< std::shared_ptr<ChecksumDefinition> > getChecksumDefinitions(QStringList &errors);
static boost::shared_ptr<ChecksumDefinition> getDefaultChecksumDefinition(const std::vector< boost::shared_ptr<ChecksumDefinition> > &available);
static void setDefaultChecksumDefinition(const boost::shared_ptr<ChecksumDefinition> &checksumDefinition);
static std::shared_ptr<ChecksumDefinition> getDefaultChecksumDefinition(const std::vector< std::shared_ptr<ChecksumDefinition> > &available);
static void setDefaultChecksumDefinition(const std::shared_ptr<ChecksumDefinition> &checksumDefinition);
protected:
void setCreateCommandArgumentPassingMethod(ArgumentPassingMethod method)
......
......@@ -17,8 +17,9 @@
*/
#include "defaultkeygenerationjob.h"
#include "kleo/cryptobackendfactory.h"
#include "kleo/keygenerationjob.h"
#include <qgpgme/protocol.h>
#include <qgpgme/keygenerationjob.h>
#include <QPointer>
#include <QEvent>
......@@ -41,7 +42,7 @@ public:
}
QString passphrase;
QPointer<KeyGenerationJob> job;
QPointer<QGpgME::KeyGenerationJob> job;
};
}
......@@ -100,13 +101,13 @@ GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString
"name-real: %3\n"
"</GnupgKeyParms>").arg(passphrase, email, name);
d->job = CryptoBackendFactory::instance()->openpgp()->keyGenerationJob();
d->job = QGpgME::openpgp()->keyGenerationJob();
d->job->installEventFilter(this);
connect(d->job.data(), &KeyGenerationJob::result,
connect(d->job.data(), &QGpgME::KeyGenerationJob::result,
this, &DefaultKeyGenerationJob::result);
connect(d->job.data(), &KeyGenerationJob::done,
connect(d->job.data(), &QGpgME::KeyGenerationJob::done,
this, &DefaultKeyGenerationJob::done);
connect(d->job.data(), &KeyGenerationJob::done,
connect(d->job.data(), &QGpgME::KeyGenerationJob::done,
this, &QObject::deleteLater);
return d->job->start(args);
}
......
......@@ -19,7 +19,7 @@
#ifndef LIBKLEO_DEFAULTKEYGENERATION_H
#define LIBKLEO_DEFAULTKEYGENERATION_H
#include "job.h"
#include <qgpgme/job.h>
#include <kleo_export.h>
......@@ -34,7 +34,7 @@ namespace Kleo {
*
* @since 5.4
*/
class KLEO_EXPORT DefaultKeyGenerationJob : public Job
class KLEO_EXPORT DefaultKeyGenerationJob : public QGpgME::Job
{
Q_OBJECT
public:
......
/*
keyformailboxjob.h
This file is part of libkleopatra, the KDE keymanagement library
Copyright (c) 2016 Intevation GmbH
Libkleopatra is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
Libkleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef __KLEO_KEYFORMAILBOX_H__
#define __KLEO_KEYFORMAILBOX_H__
#include <QString>
#include "job.h"
#include <gpgme++/key.h>
namespace GpgME
{
class Error;
class KeyListResult;
}
namespace Kleo
{
/**
@short Get the best key to use for a Mailbox
To use the keyformailboxjob, first obtain an instance from the
CryptoBackend and either exec it or start and
conncet the result() signals to a suitable slot.
The job will be automatically deleted in which
case the KeylistJob instance will have schedules it's own
destruction with a call to QObject::deleteLater().
The best key is defined as the key with a UID that has an
E-Mail that matches the mailbox provided. If multiple
keys are found the one with the highest validity is returned.
If
After result() is emitted, the
KeyListJob will schedule it's own destruction by calling
QObject::deleteLater().
*/
class KLEO_EXPORT KeyForMailboxJob: public Job
{
Q_OBJECT
protected:
explicit KeyForMailboxJob(QObject *parent);
public:
~KeyForMailboxJob();
/**
Starts the operation. \a mailbox is the mailbox to
look for.
The result is the same as for the LocateKeysJob.
If \a canEncrypt is true, only keys that have a subkey for encryption
usage are returned. Use this if you need to select a
key for signing.
*/
virtual GpgME::Error start(const QString &mailbox, bool canEncrypt = true) = 0;
virtual GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) = 0;
Q_SIGNALS:
/** The result. \a Key is the key found or a Null key.
*
* The userid is the uid where the mailbox matches.
*
* The auditlog params are always null / empty.
*/
void result(const GpgME::KeyListResult &result, const GpgME::Key &key, const GpgME::UserID &uid, const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error());
};
}
#endif
......@@ -37,10 +37,7 @@
#include "kleo/predicates.h"
#include "kleo/stl_util.h"
#include "kleo/cryptobackendfactory.h"
#include "kleo/dn.h"
#include "kleo/keylistjob.h"
#include "kleo/listallkeysjob.h"
#include "utils/filesystemwatcher.h"
#include <gpgme++/error.h>
......@@ -49,6 +46,9 @@
#include <gpgme++/verificationresult.h>
#include <gpgme++/keylistresult.h>
#include <qgpgme/protocol.h>
#include <qgpgme/listallkeysjob.h>
#include <gpg-error.h>
//#include <kmime/kmime_header_parsing.h>
......@@ -952,7 +952,7 @@ class KeyCache::RefreshKeysJob::Private
public:
Private(KeyCache *cache, RefreshKeysJob *qq);
void doStart();
Error startKeyListing(const char *protocol);
Error startKeyListing(GpgME::Protocol protocol);
void listAllKeysJobDone(const KeyListResult &res, const std::vector<Key> &nextKeys)
{
std::vector<Key> keys;
......@@ -1025,8 +1025,8 @@ void KeyCache::RefreshKeysJob::cancel()
void KeyCache::RefreshKeysJob::Private::doStart()
{
assert(m_jobsPending == 0);
m_mergedResult.mergeWith(KeyListResult(startKeyListing("openpgp")));
m_mergedResult.mergeWith(KeyListResult(startKeyListing("smime")));
m_mergedResult.mergeWith(KeyListResult(startKeyListing(GpgME::OpenPGP)));
m_mergedResult.mergeWith(KeyListResult(startKeyListing(GpgME::CMS)));
if (m_jobsPending != 0) {
return;
......@@ -1049,13 +1049,13 @@ void KeyCache::RefreshKeysJob::Private::updateKeyCache()
m_cache->refresh(m_keys);
}
Error KeyCache::RefreshKeysJob::Private::startKeyListing(const char *backend)
Error KeyCache::RefreshKeysJob::Private::startKeyListing(GpgME::Protocol proto)
{
const Kleo::CryptoBackend::Protocol *const protocol = Kleo::CryptoBackendFactory::instance()->protocol(backend);
const auto * const protocol = (proto == GpgME::OpenPGP) ? QGpgME::openpgp() : QGpgME::smime();
if (!protocol) {
return Error();
}
Kleo::ListAllKeysJob *const job = protocol->listAllKeysJob(/*includeSigs*/false, /*validate*/true);
QGpgME::ListAllKeysJob *const job = protocol->listAllKeysJob(/*includeSigs*/false, /*validate*/true);
if (!job) {
return Error();
}
......@@ -1063,7 +1063,7 @@ Error KeyCache::RefreshKeysJob::Private::startKeyListing(const char *backend)
q, SLOT(listAllKeysJobDone(GpgME::KeyListResult,std::vector<GpgME::Key>)));
connect(q, &RefreshKeysJob::canceled,
job, &Job::slotCancel);
job, &QGpgME::Job::slotCancel);
const Error error = job->start(true);
......
......@@ -29,9 +29,8 @@
your version.
*/
#include "libkleo/cryptobackendfactory.h"
#include "libkleo/keyformailboxjob.h"
#include "libkleo/keylistjob.h"
#include <qgpgme/protocol.h>
#include <qgpgme/keyformailboxjob.h>
#include <gpgme++/key.h>
#include <gpgme++/keylistresult.h>
......@@ -46,8 +45,8 @@ int main(int argc, char **argv)
mailbox = QString::fromLocal8Bit(argv[1]);
}
const Kleo::CryptoBackend::Protocol *proto = Kleo::CryptoBackendFactory::instance()->openpgp();
Kleo::KeyForMailboxJob *job = proto->keyForMailboxJob();
const auto proto = QGpgME::openpgp();
auto *job = proto->keyForMailboxJob();
GpgME::Key k;
GpgME::UserID uid;
job->exec(mailbox, true, k, uid);
......
......@@ -19,7 +19,6 @@
#include "keyselectioncombo.h"
#include <kleo_ui_debug.h>
#include "kleo/cryptobackendfactory.h"
#include "kleo/dn.h"
#include "models/keylistmodel.h"
#include "models/keylistsortfilterproxymodel.h"
......