X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsyncer.cpp;h=b7b2088d43e4c3684fba1185d0759458bcb5c73f;hp=952860a68390bc9765863410650e00b6dd04bfc4;hb=d1a410b43b09e31472b860bc5f5bbf9c253c047e;hpb=b79832bf9c4c21b05629cfd2fdbd008ad690572f diff --git a/src/client/clientsyncer.cpp b/src/client/clientsyncer.cpp index 952860a6..b7b2088d 100644 --- a/src/client/clientsyncer.cpp +++ b/src/client/clientsyncer.cpp @@ -20,7 +20,9 @@ #include "clientsyncer.h" -#include +#ifndef QT_NO_NETWORKPROXY +# include +#endif #include "client.h" #include "global.h" @@ -31,17 +33,16 @@ #include "signalproxy.h" -ClientSyncer::ClientSyncer(QObject *parent) : QObject(parent) { +ClientSyncer::ClientSyncer(QObject *parent) + : QObject(parent) +{ socket = 0; blockSize = 0; connect(Client::signalProxy(), SIGNAL(disconnected()), this, SLOT(coreSocketDisconnected())); - } ClientSyncer::~ClientSyncer() { - - } void ClientSyncer::coreHasData() { @@ -125,13 +126,19 @@ void ClientSyncer::connectToCore(const QVariantMap &conn) { #ifndef QT_NO_OPENSSL QSslSocket *sock = new QSslSocket(Client::instance()); #else + if(conn["useSsl"].toBool()) { + emit connectionError(tr("This client is built without SSL Support!
Disable the usage of SSL in the account settings.")); + emit encrypted(false); + return; + } QTcpSocket *sock = new QTcpSocket(Client::instance()); #endif - +#ifndef QT_NO_NETWORKPROXY if(conn.contains("useProxy") && conn["useProxy"].toBool()) { QNetworkProxy proxy((QNetworkProxy::ProxyType)conn["proxyType"].toInt(), conn["proxyHost"].toString(), conn["proxyPort"].toUInt(), conn["proxyUser"].toString(), conn["proxyPassword"].toString()); sock->setProxy(proxy); } +#endif socket = sock; connect(sock, SIGNAL(readyRead()), this, SLOT(coreHasData())); connect(sock, SIGNAL(connected()), this, SLOT(coreSocketConnected())); @@ -180,19 +187,16 @@ void ClientSyncer::clientInitAck(const QVariantMap &msg) { return; } emit connectionMsg(msg["CoreInfo"].toString()); + +#ifndef QT_NO_OPENSSL if(coreConnectionInfo["useSsl"].toBool()) { if(msg["SupportSsl"].toBool()) { QSslSocket *sslSocket = qobject_cast(socket); - if(sslSocket) { - connect(sslSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); - sslSocket->startClientEncryption(); - emit encrypted(true); - } else { - emit connectionError(tr("This client is built without SSL Support!
Disable the usage of SSL in the account settings.")); - emit encrypted(false); - disconnectFromCore(); - return; - } + Q_ASSERT(sslSocket); + connect(sslSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); + sslSocket->startClientEncryption(); + emit encrypted(true); + Client::instance()->setSecuredConnection(); } else { emit connectionError(tr("The Quassel Core you are trying to connect to does not support SSL!
If you want to connect anyways, disable the usage of SSL in the account settings.")); emit encrypted(false); @@ -200,6 +204,7 @@ void ClientSyncer::clientInitAck(const QVariantMap &msg) { return; } } +#endif if(!msg["Configured"].toBool()) { // start wizard @@ -359,6 +364,7 @@ void ClientSyncer::checkSyncState() { } } +#ifndef QT_NO_OPENSSL void ClientSyncer::sslErrors(const QList &errors) { qDebug() << "SSL Errors:"; foreach(QSslError err, errors) @@ -368,3 +374,4 @@ void ClientSyncer::sslErrors(const QList &errors) { if(socket) socket->ignoreSslErrors(); } +#endif