X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientidentity.h;h=4aa81c83ee430f198e6140a0dd1869e73ef834f9;hp=680ac956973799f8f34dde4456dbfbc8266cca29;hb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24;hpb=ac21cc48d22f0cf58a98b74754fa94564a8e3f45 diff --git a/src/client/clientidentity.h b/src/client/clientidentity.h index 680ac956..4aa81c83 100644 --- a/src/client/clientidentity.h +++ b/src/client/clientidentity.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,67 +15,79 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CLIENTIDENTITY_H -#define CLIENTIDENTITY_H +#pragma once + +#include "client-export.h" #include "identity.h" class ClientCertManager; -class CertIdentity : public Identity { - Q_OBJECT +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); - void enableEditSsl(bool enable = true); - inline bool isDirty() const { return _isDirty; } +#ifdef HAVE_SSL + inline bool isDirty() const { return _isDirty; } +#else + inline bool isDirty() const { return false; } +#endif - inline const QSslKey &sslKey() const { return _sslKey; } - inline const QSslCertificate &sslCert() const { return _sslCert; } +#ifdef HAVE_SSL + void enableEditSsl(bool enable = true); + 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(); + void requestUpdateSslSettings(); signals: - void sslSettingsUpdated(); + void sslSettingsUpdated(); private slots: - void markClean(); + void markClean(); private: - ClientCertManager *_certManager; - bool _isDirty; - QSslKey _sslKey; - QSslCertificate _sslCert; + ClientCertManager *_certManager; + bool _isDirty; + QSslKey _sslKey; + QSslCertificate _sslCert; +#endif //HAVE_SSL }; + // ======================================== // ClientCertManager // ======================================== -class ClientCertManager : public CertManager { - Q_OBJECT +#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 //CLIENTIDENTITY_H +#endif //HAVE_SSL