adding tons of ifdefs so quassel will build again without ssl support
authorMarcus Eggenberger <egs@quassel-irc.org>
Thu, 25 Dec 2008 16:21:53 +0000 (17:21 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Thu, 25 Dec 2008 23:03:50 +0000 (00:03 +0100)
src/client/client.cpp
src/client/clientidentity.cpp
src/client/clientidentity.h
src/common/signalproxy.cpp
src/core/coreidentity.cpp
src/core/coreidentity.h
src/core/coresession.cpp
src/core/sqlitestorage.cpp
src/qtui/settingspages/identitiessettingspage.cpp
src/qtui/settingspages/identitiessettingspage.h

index 310e8e4..295e062 100644 (file)
@@ -221,8 +221,10 @@ const Identity *Client::identity(IdentityId id) {
 
 void Client::createIdentity(const CertIdentity &id) {
   QVariantMap additional;
 
 void Client::createIdentity(const CertIdentity &id) {
   QVariantMap additional;
+#ifdef HAVE_SSL
   additional["KeyPem"] = id.sslKey().toPem();
   additional["CertPem"] = id.sslCert().toPem();
   additional["KeyPem"] = id.sslKey().toPem();
   additional["CertPem"] = id.sslCert().toPem();
+#endif
   emit instance()->requestCreateIdentity(id, additional);
 }
 
   emit instance()->requestCreateIdentity(id, additional);
 }
 
index 1d93d64..c8e8df9 100644 (file)
 #include "signalproxy.h"
 
 CertIdentity::CertIdentity(IdentityId id, QObject *parent)
 #include "signalproxy.h"
 
 CertIdentity::CertIdentity(IdentityId id, QObject *parent)
-  : Identity(id, parent),
-    _certManager(0),
+  : Identity(id, parent)
+#ifdef HAVE_SSL
+  ,  _certManager(0),
     _isDirty(false)
     _isDirty(false)
+#endif
 {
 }
 
 CertIdentity::CertIdentity(const Identity &other, QObject *parent)
 {
 }
 
 CertIdentity::CertIdentity(const Identity &other, QObject *parent)
-  : Identity(other, parent),
-    _certManager(0),
+  : Identity(other, parent)
+#ifdef HAVE_SSL
+  , _certManager(0),
     _isDirty(false)
     _isDirty(false)
+#endif
 {
 }
 
 CertIdentity::CertIdentity(const CertIdentity &other, QObject *parent)
 {
 }
 
 CertIdentity::CertIdentity(const CertIdentity &other, QObject *parent)
-  : Identity(other, parent),
-    _certManager(0),
+  : Identity(other, parent)
+#ifdef HAVE_SSL
+  , _certManager(0),
     _isDirty(other._isDirty),
     _sslKey(other._sslKey),
     _sslCert(other._sslCert)
     _isDirty(other._isDirty),
     _sslKey(other._sslKey),
     _sslCert(other._sslCert)
+#endif
 {
 }
 
 {
 }
 
+#ifdef HAVE_SSL
 void CertIdentity::enableEditSsl(bool enable) {
   if(!enable || _certManager)
     return;
 void CertIdentity::enableEditSsl(bool enable) {
   if(!enable || _certManager)
     return;
@@ -97,3 +104,6 @@ void ClientCertManager::setSslKey(const QByteArray &encoded) {
 void ClientCertManager::setSslCert(const QByteArray &encoded) {
   _certIdentity->setSslCert(QSslCertificate(encoded));
 }
 void ClientCertManager::setSslCert(const QByteArray &encoded) {
   _certIdentity->setSslCert(QSslCertificate(encoded));
 }
+
+
+#endif // HAVE_SSL
index 680ac95..62773f1 100644 (file)
@@ -33,9 +33,14 @@ public:
   CertIdentity(const Identity &other, QObject *parent = 0);
   CertIdentity(const CertIdentity &other, QObject *parent = 0);
 
   CertIdentity(const Identity &other, QObject *parent = 0);
   CertIdentity(const CertIdentity &other, QObject *parent = 0);
 
-  void enableEditSsl(bool enable = true);
+#ifdef HAVE_SSL
   inline bool isDirty() const { return _isDirty; }
   inline bool isDirty() const { return _isDirty; }
+#else
+  inline bool isDirty() const { return false; }
+#endif
 
 
+#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; }
 
@@ -56,11 +61,13 @@ private:
   bool _isDirty;
   QSslKey _sslKey;
   QSslCertificate _sslCert;
   bool _isDirty;
   QSslKey _sslKey;
   QSslCertificate _sslCert;
+#endif //HAVE_SSL
 };
 
 // ========================================
 //  ClientCertManager
 // ========================================
 };
 
 // ========================================
 //  ClientCertManager
 // ========================================
+#ifdef HAVE_SSL
 class ClientCertManager : public CertManager {
   Q_OBJECT
 
 class ClientCertManager : public CertManager {
   Q_OBJECT
 
@@ -77,5 +84,6 @@ public slots:
 private:
   CertIdentity *_certIdentity;
 };
 private:
   CertIdentity *_certIdentity;
 };
+#endif //HAVE_SSL
 
 #endif //CLIENTIDENTITY_H
 
 #endif //CLIENTIDENTITY_H
index a9172fc..7c43592 100644 (file)
@@ -32,7 +32,9 @@
 #include <QMetaMethod>
 #include <QMetaProperty>
 #include <QRegExp>
 #include <QMetaMethod>
 #include <QMetaProperty>
 #include <QRegExp>
+#ifdef HAVE_SSL
 #include <QSslSocket>
 #include <QSslSocket>
+#endif
 #include <QThread>
 #include <QTime>
 #include <QEvent>
 #include <QThread>
 #include <QTime>
 #include <QEvent>
@@ -214,9 +216,11 @@ void SignalProxy::IODevicePeer::dispatchSignal(const RequestType &requestType, c
 }
 
 bool SignalProxy::IODevicePeer::isSecure() const {
 }
 
 bool SignalProxy::IODevicePeer::isSecure() const {
+#ifdef HAVE_SSL
   QSslSocket *sslSocket = qobject_cast<QSslSocket *>(_device);
   if(sslSocket)
     return sslSocket->isEncrypted() || sslSocket->localAddress() == QHostAddress::LocalHost || sslSocket->localAddress() == QHostAddress::LocalHostIPv6;
   QSslSocket *sslSocket = qobject_cast<QSslSocket *>(_device);
   if(sslSocket)
     return sslSocket->isEncrypted() || sslSocket->localAddress() == QHostAddress::LocalHost || sslSocket->localAddress() == QHostAddress::LocalHostIPv6;
+#endif
 
   QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(_device);
   if(socket)
 
   QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(_device);
   if(socket)
@@ -335,10 +339,12 @@ bool SignalProxy::addPeer(QIODevice* iodev) {
   connect(iodev, SIGNAL(disconnected()), this, SLOT(removePeerBySender()));
   connect(iodev, SIGNAL(readyRead()), this, SLOT(dataAvailable()));
 
   connect(iodev, SIGNAL(disconnected()), this, SLOT(removePeerBySender()));
   connect(iodev, SIGNAL(readyRead()), this, SLOT(dataAvailable()));
 
+#ifdef HAVE_SSL
   QSslSocket *sslSocket = qobject_cast<QSslSocket *>(iodev);
   if(sslSocket) {
     connect(iodev, SIGNAL(encrypted()), this, SLOT(updateSecureState()));
   }
   QSslSocket *sslSocket = qobject_cast<QSslSocket *>(iodev);
   if(sslSocket) {
     connect(iodev, SIGNAL(encrypted()), this, SLOT(updateSecureState()));
   }
+#endif
 
   if(!iodev->parent())
     iodev->setParent(this);
 
   if(!iodev->parent())
     iodev->setParent(this);
index 6fe0e97..a82ef95 100644 (file)
 #include "signalproxy.h"
 
 CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
 #include "signalproxy.h"
 
 CoreIdentity::CoreIdentity(IdentityId id, QObject *parent)
-  : Identity(id, parent),
-    _certManager(*this)
+  : Identity(id, parent)
+#ifdef HAVE_SSL
+  , _certManager(*this)
+#endif
 {
 {
+#ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
+#endif
 }
 
 CoreIdentity::CoreIdentity(const Identity &other, QObject *parent)
 }
 
 CoreIdentity::CoreIdentity(const Identity &other, QObject *parent)
-  : Identity(other, parent),
-    _certManager(*this)
+  : Identity(other, parent)
+#ifdef HAVE_SSL
+  , _certManager(*this)
+#endif
 {
 {
+#ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
+#endif
 }
 
 CoreIdentity::CoreIdentity(const CoreIdentity &other, QObject *parent)
 }
 
 CoreIdentity::CoreIdentity(const CoreIdentity &other, QObject *parent)
-  : Identity(other, parent),
-    _sslKey(other._sslKey),
+  : Identity(other, parent)
+#ifdef HAVE_SSL
+  , _sslKey(other._sslKey),
     _sslCert(other._sslCert),
     _certManager(*this)
     _sslCert(other._sslCert),
     _certManager(*this)
+#endif
 {
 {
+#ifdef HAVE_SSL
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
   connect(this, SIGNAL(idSet(IdentityId)), &_certManager, SLOT(setId(IdentityId)));
+#endif
 }
 
 void CoreIdentity::synchronize(SignalProxy *proxy) {
   proxy->synchronize(this);
 }
 
 void CoreIdentity::synchronize(SignalProxy *proxy) {
   proxy->synchronize(this);
+#ifdef HAVE_SSL
   proxy->synchronize(&_certManager);
   proxy->synchronize(&_certManager);
+#endif
 }
 
 }
 
+#ifdef HAVE_SSL
 void CoreIdentity::setSslKey(const QByteArray &encoded) {
   QSslKey key(encoded, QSsl::Rsa);
   if(key.isNull())
 void CoreIdentity::setSslKey(const QByteArray &encoded) {
   QSslKey key(encoded, QSsl::Rsa);
   if(key.isNull())
@@ -60,14 +75,18 @@ void CoreIdentity::setSslKey(const QByteArray &encoded) {
 void CoreIdentity::setSslCert(const QByteArray &encoded) {
   setSslCert(QSslCertificate(encoded));
 }
 void CoreIdentity::setSslCert(const QByteArray &encoded) {
   setSslCert(QSslCertificate(encoded));
 }
+#endif
 
 CoreIdentity &CoreIdentity::operator=(const CoreIdentity &identity) {
   Identity::operator=(identity);
 
 CoreIdentity &CoreIdentity::operator=(const CoreIdentity &identity) {
   Identity::operator=(identity);
+#ifdef HAVE_SSL
   _sslKey = identity._sslKey;
   _sslCert = identity._sslCert;
   _sslKey = identity._sslKey;
   _sslCert = identity._sslCert;
+#endif
   return *this;
 }
 
   return *this;
 }
 
+#ifdef HAVE_SSL
 // ========================================
 //  CoreCertManager
 // ========================================
 // ========================================
 //  CoreCertManager
 // ========================================
@@ -78,6 +97,10 @@ CoreCertManager::CoreCertManager(CoreIdentity &identity)
   setAllowClientUpdates(true);
 }
 
   setAllowClientUpdates(true);
 }
 
+void CoreCertManager::setId(IdentityId id) {
+  renameObject(QString::number(id.toInt()));
+}
+
 void CoreCertManager::setSslKey(const QByteArray &encoded) {
   identity.setSslKey(encoded);
   CertManager::setSslKey(encoded);
 void CoreCertManager::setSslKey(const QByteArray &encoded) {
   identity.setSslKey(encoded);
   CertManager::setSslKey(encoded);
@@ -87,7 +110,4 @@ void CoreCertManager::setSslCert(const QByteArray &encoded) {
   identity.setSslCert(encoded);
   CertManager::setSslCert(encoded);
 }
   identity.setSslCert(encoded);
   CertManager::setSslCert(encoded);
 }
-
-void CoreCertManager::setId(IdentityId id) {
-  renameObject(QString::number(id.toInt()));
-}
+#endif //HAVE_SSL
index f87f531..8033030 100644 (file)
 
 #include "identity.h"
 
 
 #include "identity.h"
 
+#ifdef HAVE_SSL
 #include <QSslKey>
 #include <QSslCertificate>
 #include <QSslKey>
 #include <QSslCertificate>
+#endif //HAVE_SSL
 
 
-class CoreIdentity;
 class SignalProxy;
 
 // ========================================
 //  CoreCertManager
 // ========================================
 class SignalProxy;
 
 // ========================================
 //  CoreCertManager
 // ========================================
+#ifdef HAVE_SSL
+class CoreIdentity;
 class CoreCertManager : public CertManager {
   Q_OBJECT
 
 public:
   CoreCertManager(CoreIdentity &identity);
 
 class CoreCertManager : public CertManager {
   Q_OBJECT
 
 public:
   CoreCertManager(CoreIdentity &identity);
 
+  void setId(IdentityId id);
+
+#ifdef HAVE_SSL
   virtual const QSslKey &sslKey() const;
   virtual const QSslCertificate &sslCert() const;
 
 public slots:
   virtual void setSslKey(const QByteArray &encoded);
   virtual void setSslCert(const QByteArray &encoded);
   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);
+#endif
 
 private:
   CoreIdentity &identity;
 };
 
 private:
   CoreIdentity &identity;
 };
+#endif //HAVE_SSL
 
 // =========================================
 //  CoreIdentity
 
 // =========================================
 //  CoreIdentity
@@ -64,29 +70,33 @@ public:
 
   void synchronize(SignalProxy *proxy);
 
 
   void synchronize(SignalProxy *proxy);
 
+#ifdef HAVE_SSL
   inline const QSslKey &sslKey() const { return _sslKey; }
   inline void setSslKey(const QSslKey &key) { _sslKey = key; }
   void setSslKey(const QByteArray &encoded);
   inline const QSslCertificate &sslCert() const { return _sslCert; }
   inline void setSslCert(const QSslCertificate &cert) { _sslCert = cert; }
   void setSslCert(const QByteArray &encoded);
   inline const QSslKey &sslKey() const { return _sslKey; }
   inline void setSslKey(const QSslKey &key) { _sslKey = key; }
   void setSslKey(const QByteArray &encoded);
   inline const QSslCertificate &sslCert() const { return _sslCert; }
   inline void setSslCert(const QSslCertificate &cert) { _sslCert = cert; }
   void setSslCert(const QByteArray &encoded);
+#endif HAVE_SSL
 
   CoreIdentity& CoreIdentity::operator=(const CoreIdentity &identity);
 
 private:
 
   CoreIdentity& CoreIdentity::operator=(const CoreIdentity &identity);
 
 private:
+#ifdef HAVE_SSL
   QSslKey _sslKey;
   QSslCertificate _sslCert;
 
   CoreCertManager _certManager;
   QSslKey _sslKey;
   QSslCertificate _sslCert;
 
   CoreCertManager _certManager;
+#endif
 };
 
 };
 
+#ifdef HAVE_SSL
 inline const QSslKey &CoreCertManager::sslKey() const {
   return identity.sslKey();
 }
 inline const QSslCertificate &CoreCertManager::sslCert() const {
   return identity.sslCert();
 }
 inline const QSslKey &CoreCertManager::sslKey() const {
   return identity.sslKey();
 }
 inline const QSslCertificate &CoreCertManager::sslCert() const {
   return identity.sslCert();
 }
-
-
+#endif
 
 #endif //COREIDENTITY_H
 
 #endif //COREIDENTITY_H
index 3a05f52..f18f926 100644 (file)
@@ -285,11 +285,17 @@ void CoreSession::scriptRequest(QString script) {
 
 /*** Identity Handling ***/
 void CoreSession::createIdentity(const Identity &identity, const QVariantMap &additional) {
 
 /*** Identity Handling ***/
 void CoreSession::createIdentity(const Identity &identity, const QVariantMap &additional) {
+#ifndef HAVE_SSL
+  Q_UNUSED(additional)
+#endif
+
   CoreIdentity coreIdentity(identity);
   CoreIdentity coreIdentity(identity);
+#ifdef HAVE_SSL
   if(additional.contains("KeyPem"))
     coreIdentity.setSslKey(additional["KeyPem"].toByteArray());
   if(additional.contains("CertPem"))
     coreIdentity.setSslCert(additional["CertPem"].toByteArray());
   if(additional.contains("KeyPem"))
     coreIdentity.setSslKey(additional["KeyPem"].toByteArray());
   if(additional.contains("CertPem"))
     coreIdentity.setSslCert(additional["CertPem"].toByteArray());
+#endif
   IdentityId id = Core::createIdentity(user(), coreIdentity);
   if(!id.isValid())
     return;
   IdentityId id = Core::createIdentity(user(), coreIdentity);
   if(!id.isValid())
     return;
index a418d05..392459b 100644 (file)
@@ -214,8 +214,14 @@ IdentityId SqliteStorage::createIdentity(UserId user, CoreIdentity &identity) {
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
+#ifdef HAVE_SSL
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
+#else
+  query.bindValue(":sslcert", QByteArray());
+  query.bindValue(":sslkey", QByteArray());
+#endif
+
   safeExec(query);
 
   identityId = query.lastInsertId().toInt();
   safeExec(query);
 
   identityId = query.lastInsertId().toInt();
@@ -269,8 +275,13 @@ bool SqliteStorage::updateIdentity(UserId user, const CoreIdentity &identity) {
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
+#ifdef HAVE_SSL
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
+#else
+  query.bindValue(":sslcert", QByteArray());
+  query.bindValue(":sslkey", QByteArray());
+#endif
   query.bindValue(":identityid", identity.id().toInt());
   safeExec(query);
 
   query.bindValue(":identityid", identity.id().toInt());
   safeExec(query);
 
@@ -344,8 +355,10 @@ QList<CoreIdentity> SqliteStorage::identities(UserId user) {
     identity.setKickReason(query.value(15).toString());
     identity.setPartReason(query.value(16).toString());
     identity.setQuitReason(query.value(17).toString());
     identity.setKickReason(query.value(15).toString());
     identity.setPartReason(query.value(16).toString());
     identity.setQuitReason(query.value(17).toString());
+#ifdef HAVE_SSL
     identity.setSslCert(query.value(18).toByteArray());
     identity.setSslKey(query.value(19).toByteArray());
     identity.setSslCert(query.value(18).toByteArray());
     identity.setSslKey(query.value(19).toByteArray());
+#endif
 
     nickQuery.bindValue(":identityid", identity.id().toInt());
     QList<QString> nicks;
 
     nickQuery.bindValue(":identityid", identity.id().toInt());
     QList<QString> nicks;
index e8bb680..788df96 100644 (file)
@@ -80,10 +80,12 @@ IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
   //connect(ui.nicknameList, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(setWidgetStates()));
   //connect(ui.nicknameList->model(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(nicklistHasChanged()));
 
   //connect(ui.nicknameList, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(setWidgetStates()));
   //connect(ui.nicknameList->model(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(nicklistHasChanged()));
 
+#ifdef HAVE_SSL
   ui.sslKeyGroupBox->setAcceptDrops(true);
   ui.sslKeyGroupBox->installEventFilter(this);
   ui.sslCertGroupBox->setAcceptDrops(true);
   ui.sslCertGroupBox->installEventFilter(this);
   ui.sslKeyGroupBox->setAcceptDrops(true);
   ui.sslKeyGroupBox->installEventFilter(this);
   ui.sslCertGroupBox->setAcceptDrops(true);
   ui.sslCertGroupBox->installEventFilter(this);
+#endif
 }
 
 void IdentitiesSettingsPage::setWidgetStates() {
 }
 
 void IdentitiesSettingsPage::setWidgetStates() {
@@ -213,9 +215,13 @@ bool IdentitiesSettingsPage::aboutToSave() {
 
 void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id) {
   CertIdentity *identity = new CertIdentity(*Client::identity(id), this);
 
 void IdentitiesSettingsPage::clientIdentityCreated(IdentityId id) {
   CertIdentity *identity = new CertIdentity(*Client::identity(id), this);
+#ifdef HAVE_SSL
   identity->enableEditSsl(_editSsl);
   identity->enableEditSsl(_editSsl);
+#endif
   insertIdentity(identity);
   insertIdentity(identity);
+#ifdef HAVE_SSL
   connect(identity, SIGNAL(sslSettingsUpdated()), this, SLOT(clientIdentityUpdated()));
   connect(identity, SIGNAL(sslSettingsUpdated()), this, SLOT(clientIdentityUpdated()));
+#endif
   connect(Client::identity(id), SIGNAL(updatedRemotely()), this, SLOT(clientIdentityUpdated()));
 }
 
   connect(Client::identity(id), SIGNAL(updatedRemotely()), this, SLOT(clientIdentityUpdated()));
 }
 
@@ -325,8 +331,10 @@ void IdentitiesSettingsPage::displayIdentity(CertIdentity *id, bool dontsave) {
     ui.kickReason->setText(id->kickReason());
     ui.partReason->setText(id->partReason());
     ui.quitReason->setText(id->quitReason());
     ui.kickReason->setText(id->kickReason());
     ui.partReason->setText(id->partReason());
     ui.quitReason->setText(id->quitReason());
+#ifdef HAVE_SSL
     showKeyState(id->sslKey());
     showCertState(id->sslCert());
     showKeyState(id->sslKey());
     showCertState(id->sslCert());
+#endif
   }
 }
 
   }
 }
 
@@ -352,8 +360,10 @@ void IdentitiesSettingsPage::saveToIdentity(CertIdentity *id) {
   id->setKickReason(ui.kickReason->text());
   id->setPartReason(ui.partReason->text());
   id->setQuitReason(ui.quitReason->text());
   id->setKickReason(ui.kickReason->text());
   id->setPartReason(ui.partReason->text());
   id->setQuitReason(ui.quitReason->text());
+#ifdef HAVE_SSL
   id->setSslKey(QSslKey(ui.keyTypeLabel->property("sslKey").toByteArray(), (QSsl::KeyAlgorithm)(ui.keyTypeLabel->property("sslKeyType").toInt())));
   id->setSslCert(QSslCertificate(ui.certOrgLabel->property("sslCert").toByteArray()));
   id->setSslKey(QSslKey(ui.keyTypeLabel->property("sslKey").toByteArray(), (QSsl::KeyAlgorithm)(ui.keyTypeLabel->property("sslKeyType").toInt())));
   id->setSslCert(QSslCertificate(ui.certOrgLabel->property("sslCert").toByteArray()));
+#endif
 }
 
 void IdentitiesSettingsPage::on_addIdentity_clicked() {
 }
 
 void IdentitiesSettingsPage::on_addIdentity_clicked() {
@@ -366,7 +376,9 @@ void IdentitiesSettingsPage::on_addIdentity_clicked() {
     }
     id = -id.toInt();
     CertIdentity *newId = new CertIdentity(id, this);
     }
     id = -id.toInt();
     CertIdentity *newId = new CertIdentity(id, this);
+#ifdef HAVE_SSL
     newId->enableEditSsl(_editSsl);
     newId->enableEditSsl(_editSsl);
+#endif
     if(dlg.duplicateId() != 0) {
       // duplicate
       newId->update(*identities[dlg.duplicateId()]);
     if(dlg.duplicateId() != 0) {
       // duplicate
       newId->update(*identities[dlg.duplicateId()]);
@@ -459,6 +471,7 @@ void IdentitiesSettingsPage::on_nickDown_clicked() {
   }
 }
 
   }
 }
 
+#ifdef HAVE_SSL
 void IdentitiesSettingsPage::on_continueUnsecured_clicked() {
   _editSsl = true;
 
 void IdentitiesSettingsPage::on_continueUnsecured_clicked() {
   _editSsl = true;
 
@@ -601,6 +614,7 @@ void IdentitiesSettingsPage::showCertState(const QSslCertificate &cert) {
   }
   ui.certOrgLabel->setProperty("sslCert", cert.toPem());
  }
   }
   ui.certOrgLabel->setProperty("sslCert", cert.toPem());
  }
+#endif //HAVE_SSL
 
 /*****************************************************************************************/
 
 
 /*****************************************************************************************/
 
@@ -659,7 +673,9 @@ SaveIdentitiesDlg::SaveIdentitiesDlg(const QList<CertIdentity *> &toCreate, cons
       }
       connect(cid, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
       Client::updateIdentity(id->id(), id->toVariantMap());
       }
       connect(cid, SIGNAL(updatedRemotely()), this, SLOT(clientEvent()));
       Client::updateIdentity(id->id(), id->toVariantMap());
+#ifdef HAVE_SSL
       id->requestUpdateSslSettings();
       id->requestUpdateSslSettings();
+#endif
     }
     foreach(IdentityId id, toRemove) {
       Client::removeIdentity(id);
     }
     foreach(IdentityId id, toRemove) {
       Client::removeIdentity(id);
index 1ef8223..37c5ec2 100644 (file)
 #include "ui_saveidentitiesdlg.h"
 #include "ui_nickeditdlg.h"
 
 #include "ui_saveidentitiesdlg.h"
 #include "ui_nickeditdlg.h"
 
+#ifdef HAVE_SSL
 #include <QSslCertificate>
 #include <QSslKey>
 #include <QSslCertificate>
 #include <QSslKey>
+#endif
 
 class QAbstractItemModel;
 
 
 class QAbstractItemModel;
 
@@ -46,8 +48,10 @@ public slots:
   void save();
   void load();
 
   void save();
   void load();
 
+#ifdef HAVE_SSL
 protected:
   virtual bool eventFilter(QObject *watched, QEvent *event);
 protected:
   virtual bool eventFilter(QObject *watched, QEvent *event);
+#endif
 
 private slots:
   void coreConnectionStateChanged(bool);
 
 private slots:
   void coreConnectionStateChanged(bool);
@@ -67,14 +71,18 @@ private slots:
   void on_nickUp_clicked();
   void on_nickDown_clicked();
 
   void on_nickUp_clicked();
   void on_nickDown_clicked();
 
+#ifdef HAVE_SSL
   void on_continueUnsecured_clicked();
   void on_clearOrLoadKeyButton_clicked();
   void on_clearOrLoadCertButton_clicked();
   void on_continueUnsecured_clicked();
   void on_clearOrLoadKeyButton_clicked();
   void on_clearOrLoadCertButton_clicked();
+#endif
   void widgetHasChanged();
   void setWidgetStates();
 
   void widgetHasChanged();
   void setWidgetStates();
 
+#ifdef HAVE_SSL
   void sslDragEnterEvent(QDragEnterEvent *event);
   void sslDropEvent(QDropEvent *event, bool isCert);
   void sslDragEnterEvent(QDragEnterEvent *event);
   void sslDropEvent(QDropEvent *event, bool isCert);
+#endif
 
 private:
   Ui::IdentitiesSettingsPage ui;
 
 private:
   Ui::IdentitiesSettingsPage ui;
@@ -93,10 +101,12 @@ private:
   void displayIdentity(CertIdentity *, bool dontsave = false);
   void saveToIdentity(CertIdentity *);
 
   void displayIdentity(CertIdentity *, bool dontsave = false);
   void saveToIdentity(CertIdentity *);
 
+#ifdef HAVE_SSL
   QSslKey keyByFilename(const QString &filename);
   void showKeyState(const QSslKey &key);
   QSslCertificate certByFilename(const QString &filename);
   void showCertState(const QSslCertificate &cert);
   QSslKey keyByFilename(const QString &filename);
   void showKeyState(const QSslKey &key);
   QSslCertificate certByFilename(const QString &filename);
   void showCertState(const QSslCertificate &cert);
+#endif
 
   bool testHasChanged();
 };
 
   bool testHasChanged();
 };