Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
c714932e
Commit
c714932e
authored
Jul 25, 2015
by
Fabio Bas
Browse files
Fix compilation under OSX with homebrew's qt5.5
parent
1ffc9b45
Changes
3
Hide whitespace changes
Inline
Side-by-side
servatrice/src/smtp/qxtsmtp.cpp
View file @
c714932e
...
...
@@ -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
()
...
...
servatrice/src/smtp/qxtsmtp.h
View file @
c714932e
...
...
@@ -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
);
...
...
servatrice/src/smtp/qxtsmtp_p.h
View file @
c714932e
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment