X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fclientidentity.h;h=dfdf2b3df07e1629463e2adb9e748562e867f18a;hb=db00831bca59a012242d1ad5fac52a20c6cd2956;hp=9f6fdc075231ad9b498c7ea0c332fb9f25f41a27;hpb=3e63cb8a6e83765069a45101b86ae9e21dcc57ad;p=quassel.git diff --git a/src/client/clientidentity.h b/src/client/clientidentity.h index 9f6fdc07..dfdf2b3d 100644 --- a/src/client/clientidentity.h +++ b/src/client/clientidentity.h @@ -20,18 +20,20 @@ #pragma once +#include "client-export.h" + #include "identity.h" class ClientCertManager; -class CertIdentity : public Identity +class CLIENT_EXPORT CertIdentity : public Identity { Q_OBJECT public: - CertIdentity(IdentityId id = 0, QObject *parent = 0); - CertIdentity(const Identity &other, QObject *parent = 0); - CertIdentity(const CertIdentity &other, QObject *parent = 0); + CertIdentity(IdentityId id = 0, QObject* parent = nullptr); + CertIdentity(const Identity& other, QObject* parent = nullptr); + CertIdentity(const CertIdentity& other, QObject* parent = nullptr); #ifdef HAVE_SSL inline bool isDirty() const { return _isDirty; } @@ -41,11 +43,11 @@ public: #ifdef HAVE_SSL void enableEditSsl(bool enable = true); - inline const QSslKey &sslKey() const { return _sslKey; } - inline const QSslCertificate &sslCert() const { return _sslCert; } + inline const QSslKey& sslKey() const { return _sslKey; } + inline const QSslCertificate& sslCert() const { return _sslCert; } - void setSslKey(const QSslKey &key); - void setSslCert(const QSslCertificate &cert); + void setSslKey(const QSslKey& key); + void setSslCert(const QSslCertificate& cert); public slots: void requestUpdateSslSettings(); @@ -57,34 +59,37 @@ private slots: void markClean(); private: - ClientCertManager *_certManager; - bool _isDirty; + ClientCertManager* _certManager{nullptr}; + bool _isDirty{false}; QSslKey _sslKey; QSslCertificate _sslCert; -#endif //HAVE_SSL +#endif // HAVE_SSL }; - // ======================================== // ClientCertManager // ======================================== #ifdef HAVE_SSL + class ClientCertManager : public CertManager { Q_OBJECT public: - ClientCertManager(IdentityId id, CertIdentity *parent) : CertManager(id, parent), _certIdentity(parent) {} + ClientCertManager(IdentityId id, CertIdentity* parent) + : CertManager(id, parent) + , _certIdentity(parent) + {} - virtual inline const QSslKey &sslKey() const { return _certIdentity->sslKey(); } - virtual inline const QSslCertificate &sslCert() const { return _certIdentity->sslCert(); } + inline const QSslKey& sslKey() const override { return _certIdentity->sslKey(); } + inline const QSslCertificate& sslCert() const override { return _certIdentity->sslCert(); } public slots: - virtual void setSslKey(const QByteArray &encoded); - virtual void setSslCert(const QByteArray &encoded); + void setSslKey(const QByteArray& encoded) override; + void setSslCert(const QByteArray& encoded) override; private: - CertIdentity *_certIdentity; + CertIdentity* _certIdentity; }; -#endif //HAVE_SSL +#endif // HAVE_SSL