Fix coding style

This commit is contained in:
thalieht 2018-04-14 22:53:45 +03:00 committed by sledgehammer999
parent 8707a1bc86
commit 96d9d810fd
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
60 changed files with 308 additions and 346 deletions

View file

@ -130,8 +130,8 @@ Smtp::~Smtp()
void Smtp::sendMail(const QString &from, const QString &to, const QString &subject, const QString &body)
{
const Preferences* const pref = Preferences::instance();
QTextCodec* latin1 = QTextCodec::codecForName("latin1");
const Preferences *const pref = Preferences::instance();
QTextCodec *latin1 = QTextCodec::codecForName("latin1");
m_message = "Date: " + getCurrentDateTime().toLatin1() + "\r\n"
+ encodeMimeHeader("From", from, latin1)
+ encodeMimeHeader("Subject", subject, latin1)
@ -141,8 +141,8 @@ void Smtp::sendMail(const QString &from, const QString &to, const QString &subje
+ "Content-Transfer-Encoding: base64\r\n"
+ "\r\n";
// Encode the body in base64
QString crlf_body = body;
QByteArray b = crlf_body.replace("\n", "\r\n").toUtf8().toBase64();
QString crlfBody = body;
QByteArray b = crlfBody.replace("\n", "\r\n").toUtf8().toBase64();
int ct = b.length();
for (int i = 0; i < ct; i += 78)
m_message += b.mid(i, 78);
@ -165,7 +165,7 @@ void Smtp::sendMail(const QString &from, const QString &to, const QString &subje
m_socket->connectToHost(pref->getMailNotificationSMTP(), DEFAULT_PORT);
m_useSsl = false;
#ifndef QT_NO_OPENSSL
}
}
#endif
}
@ -184,7 +184,7 @@ void Smtp::readyRead()
QByteArray code = line.left(3);
switch (m_state) {
case Init: {
case Init:
if (code[0] == '2') {
// The server may send a multiline greeting/INIT/220 response.
// We wait until it finishes.
@ -198,7 +198,6 @@ void Smtp::readyRead()
m_state = Close;
}
break;
}
case EhloSent:
case HeloSent:
case EhloGreetReceived:
@ -448,7 +447,7 @@ void Smtp::startTLS()
#endif
}
void Smtp::authCramMD5(const QByteArray& challenge)
void Smtp::authCramMD5(const QByteArray &challenge)
{
if (m_state != AuthRequestSent) {
m_socket->write("auth cram-md5\r\n");