Fix compilation under OSX with homebrew's qt5.5

This commit is contained in:
Fabio Bas 2015-07-25 19:28:30 +02:00
parent 1ffc9b4561
commit c714932e25
3 changed files with 1 additions and 23 deletions

View file

@ -38,9 +38,7 @@
#include <QStringList>
#include <QTcpSocket>
#include <QNetworkInterface>
#ifndef QT_NO_OPENSSL
# include <QSslSocket>
#endif
#include <QSslSocket>
QxtSmtpPrivate::QxtSmtpPrivate() : QObject(0)
{
@ -52,13 +50,9 @@ QxtSmtp::QxtSmtp(QObject* parent) : QObject(parent)
QXT_INIT_PRIVATE(QxtSmtp);
qxt_d().state = QxtSmtpPrivate::Disconnected;
qxt_d().nextID = 0;
#ifndef QT_NO_OPENSSL
qxt_d().socket = new QSslSocket(this);
QObject::connect(socket(), SIGNAL(encrypted()), this, SIGNAL(encrypted()));
//QObject::connect(socket(), SIGNAL(encrypted()), &qxt_d(), SLOT(ehlo()));
#else
qxt_d().socket = new QTcpSocket(this);
#endif
QObject::connect(socket(), SIGNAL(connected()), this, SIGNAL(connected()));
QObject::connect(socket(), SIGNAL(disconnected()), this, SIGNAL(disconnected()));
QObject::connect(socket(), SIGNAL(error(QAbstractSocket::SocketError)), &qxt_d(), SLOT(socketError(QAbstractSocket::SocketError)));
@ -132,7 +126,6 @@ void QxtSmtp::setStartTlsDisabled(bool disable)
qxt_d().disableStartTLS = disable;
}
#ifndef QT_NO_OPENSSL
QSslSocket* QxtSmtp::sslSocket() const
{
return qxt_d().socket;
@ -149,7 +142,6 @@ void QxtSmtp::connectToSecureHost(const QHostAddress& address, quint16 port)
{
connectToSecureHost(address.toString(), port);
}
#endif
bool QxtSmtp::hasExtension(const QString& extension)
{
@ -202,7 +194,6 @@ void QxtSmtpPrivate::socketRead()
case EhloGreetReceived:
parseEhlo(code, (line[3] != ' '), line.mid(4));
break;
#ifndef QT_NO_OPENSSL
case StartTLSSent:
if (code == "220")
{
@ -214,7 +205,6 @@ void QxtSmtpPrivate::socketRead()
authenticate();
}
break;
#endif
case AuthRequestSent:
case AuthUsernameSent:
if (authType == AuthPlain) authPlain();
@ -359,12 +349,8 @@ void QxtSmtpPrivate::parseEhlo(const QByteArray& code, bool cont, const QString&
void QxtSmtpPrivate::startTLS()
{
#ifndef QT_NO_OPENSSL
socket->write("starttls\r\n");
state = StartTLSSent;
#else
authenticate();
#endif
}
void QxtSmtpPrivate::authenticate()

View file

@ -33,9 +33,7 @@
#include "qxtmailmessage.h"
class QTcpSocket;
#ifndef QT_NO_OPENSSL
class QSslSocket;
#endif
class QxtSmtpPrivate;
class QXT_NETWORK_EXPORT QxtSmtp : public QObject
@ -77,11 +75,9 @@ public:
bool startTlsDisabled() const;
void setStartTlsDisabled(bool disable);
#ifndef QT_NO_OPENSSL
QSslSocket* sslSocket() const;
void connectToSecureHost(const QString& hostName, quint16 port = 465);
void connectToSecureHost(const QHostAddress& address, quint16 port = 465);
#endif
bool hasExtension(const QString& extension);
QString extensionData(const QString& extension);

View file

@ -78,11 +78,7 @@ public:
int nextID, rcptNumber, rcptAck;
bool mailAck;
#ifndef QT_NO_OPENSSL
QSslSocket* socket;
#else
QTcpSocket* socket;
#endif
void parseEhlo(const QByteArray& code, bool cont, const QString& line);
void startTLS();