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