Commit 3a45b2a6 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Minor cleanups

* reduce includes in header
* use unique_ptr for pimpl pointers
* explicitly use default for destructors
parent 3174f298
......@@ -12,16 +12,15 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <gpgme++/key.h>
#include "libkleo_debug.h"
#include "keyresolver.h"
#include "models/keycache.h"
#include "ui/newkeyapprovaldialog.h"
#include "utils/formatting.h"
#include "ui/newkeyapprovaldialog.h"
#include <gpgme++/key.h>
#include <QStringList>
#include "libkleo_debug.h"
using namespace Kleo;
......@@ -60,9 +59,7 @@ public:
{
}
~Private()
{
}
~Private() = default;
bool isAcceptableSigningKey(const GpgME::Key &key)
{
......@@ -651,6 +648,8 @@ KeyResolver::KeyResolver(bool encrypt, bool sign, CryptoMessageFormat fmt, bool
{
}
Kleo::KeyResolver::~KeyResolver() = default;
void KeyResolver::setRecipients(const QStringList &addresses)
{
d->addRecpients(addresses, false);
......
......@@ -11,18 +11,23 @@
#define __KLEO_KEYRESOLVER_H__
#include "kleo_export.h"
#include <Libkleo/Enum>
#include <gpgme++/key.h>
#include <Libkleo/Enum>
#include <vector>
#include <QMap>
#include <QString>
#include <QObject>
#include <QString>
#include <QStringList>
#include <gpgme++/global.h>
#include <memory>
#include <vector>
#include <QStringList>
namespace GpgME
{
class Key;
}
namespace Kleo
{
......@@ -92,7 +97,7 @@ public:
explicit KeyResolver(bool encrypt, bool sign,
CryptoMessageFormat format = AutoFormat,
bool allowMixed = true);
~KeyResolver() {}
~KeyResolver() override;
/**
* Set the list of (To/CC) recipient addresses. Also looks
......@@ -223,8 +228,7 @@ Q_SIGNALS:
private:
class Private;
friend class Private;
std::shared_ptr<Private> d;
std::unique_ptr<Private> d;
};
} // namespace Kleo
......
......@@ -15,6 +15,8 @@
#include <QDebug>
#include <QTimer>
#include <gpgme++/key.h>
using namespace Kleo;
void dumpKeys(const QMap <CryptoMessageFormat, QMap<QString, std::vector<GpgME::Key> > > &fmtMap)
......
......@@ -296,6 +296,8 @@ public:
}
~Private() = default;
void generateKey(KeySelectionCombo *combo)
{
const auto &addr = combo->property("address").toString();
......@@ -689,8 +691,6 @@ public:
}
}
~Private() {}
GpgME::Protocol mProto;
QList<KeySelectionCombo *> mSigningCombos;
QList<KeySelectionCombo *> mEncCombos;
......@@ -735,6 +735,8 @@ NewKeyApprovalDialog::NewKeyApprovalDialog(const QMap<QString, std::vector<GpgME
resize(QSize(desk.width() / 3, qMin(size.height(), desk.height() / 2)));
}
Kleo::NewKeyApprovalDialog::~NewKeyApprovalDialog() = default;
std::vector<GpgME::Key> NewKeyApprovalDialog::signingKeys()
{
return d->mAcceptedSig;
......
......@@ -75,6 +75,8 @@ public:
QWidget *parent = nullptr,
Qt::WindowFlags f = Qt::WindowFlags());
~NewKeyApprovalDialog() override;
/** @brief The selected signing Keys. Only valid after Dialog was accepted. */
std::vector<GpgME::Key> signingKeys();
/** @brief The selected encryption Keys. Only valid after Dialog was accepted. */
......@@ -82,7 +84,7 @@ public:
private:
class Private;
std::shared_ptr<Private> d;
std::unique_ptr<Private> d;
};
} // namespace kleo
......
Markdown is supported
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