X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreidentity.h;h=f87f5314c2ae332c485935cc9128542c7d936ae3;hp=f22ea441057eca71f2b51ad33afde3a6d4deaa3b;hb=4c83963b1d77f4c2dbae606876be0eee59f53dae;hpb=061528786d1dac1d1bf4904c86b71d95270dfd37 diff --git a/src/core/coreidentity.h b/src/core/coreidentity.h index f22ea441..f87f5314 100644 --- a/src/core/coreidentity.h +++ b/src/core/coreidentity.h @@ -26,16 +26,43 @@ #include #include -class CoreCertManager; -class CoreSession; +class CoreIdentity; class SignalProxy; +// ======================================== +// CoreCertManager +// ======================================== +class CoreCertManager : public CertManager { + Q_OBJECT + +public: + CoreCertManager(CoreIdentity &identity); + + virtual const QSslKey &sslKey() const; + virtual const QSslCertificate &sslCert() const; + +public slots: + virtual void setSslKey(const QByteArray &encoded); + virtual void setSslCert(const QByteArray &encoded); + + void setId(IdentityId id); + +private: + CoreIdentity &identity; +}; + +// ========================================= +// CoreIdentity +// ========================================= class CoreIdentity : public Identity { Q_OBJECT public: - CoreIdentity(IdentityId id, SignalProxy *proxy, CoreSession *parent); - CoreIdentity(const Identity &other, SignalProxy *proxy, CoreSession *parent); + CoreIdentity(IdentityId id, QObject *parent = 0); + CoreIdentity(const Identity &other, QObject *parent = 0); + CoreIdentity(const CoreIdentity &other, QObject *parent = 0); + + void synchronize(SignalProxy *proxy); inline const QSslKey &sslKey() const { return _sslKey; } inline void setSslKey(const QSslKey &key) { _sslKey = key; } @@ -44,40 +71,22 @@ public: inline void setSslCert(const QSslCertificate &cert) { _sslCert = cert; } void setSslCert(const QByteArray &encoded); -public slots: - virtual void update(const QVariantMap &properties); - void save(); + CoreIdentity& CoreIdentity::operator=(const CoreIdentity &identity); private: QSslKey _sslKey; QSslCertificate _sslCert; - CoreCertManager *_certManager; - CoreSession *_coreSession; + CoreCertManager _certManager; }; +inline const QSslKey &CoreCertManager::sslKey() const { + return identity.sslKey(); +} +inline const QSslCertificate &CoreCertManager::sslCert() const { + return identity.sslCert(); +} -// ======================================== -// CoreCertManager -// ======================================== -class CoreCertManager : public CertManager { - Q_OBJECT - -public: - CoreCertManager(CoreIdentity *identity); - - inline CoreIdentity *identity() const { return _identity; } - virtual inline const QSslKey &sslKey() const { return identity()->sslKey(); } - virtual inline const QSslCertificate &sslCert() const { return identity()->sslCert(); } - -public slots: - virtual void setSslKey(const QByteArray &encoded); - virtual void setSslCert(const QByteArray &encoded); - void setId(IdentityId id); - -private: - CoreIdentity *_identity; -}; #endif //COREIDENTITY_H