Commit 4aca43dc authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Use std::unique_ptr for d-pointer and initialize members in-class

GnuPG-bug-id: 5245
parent 4c3d353b
......@@ -405,22 +405,24 @@ public:
private:
CertifyWidget *const q;
QLabel *mFprLabel;
KeySelectionCombo *mSecKeySelect;
QCheckBox *mExportCB;
QCheckBox *mPublishCB;
QLineEdit *mTagsLE;
QLabel *mFprLabel = nullptr;
KeySelectionCombo *mSecKeySelect = nullptr;
QCheckBox *mExportCB = nullptr;
QCheckBox *mPublishCB = nullptr;
QLineEdit *mTagsLE = nullptr;
UserIDModel mUserIDModel;
GpgME::Key mTarget;
};
CertifyWidget::CertifyWidget(QWidget *parent) :
QWidget(parent),
d(new Private(this))
CertifyWidget::CertifyWidget(QWidget *parent)
: QWidget{parent}
, d{std::make_unique<Private>(this)}
{
}
Kleo::CertifyWidget::~CertifyWidget() = default;
void CertifyWidget::setTarget(const GpgME::Key &key)
{
d->setTarget(key);
......
......@@ -27,6 +27,8 @@ class CertifyWidget : public QWidget
public:
explicit CertifyWidget(QWidget *parent = nullptr);
~CertifyWidget() override;
/* Set the key to certify */
void setTarget(const GpgME::Key &key);
......@@ -53,7 +55,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