Changeset View
Changeset View
Standalone View
Standalone View
kioslave/pop3/pop3.cpp
Show All 24 Lines | |||||
35 | #include <QCoreApplication> | 35 | #include <QCoreApplication> | ||
36 | #include <QByteArray> | 36 | #include <QByteArray> | ||
37 | #include <QRegExp> | 37 | #include <QRegExp> | ||
38 | #include "pop3_debug.h" | 38 | #include "pop3_debug.h" | ||
39 | 39 | | |||
40 | #include <qdebug.h> | 40 | #include <qdebug.h> | ||
41 | #include <KLocalizedString> | 41 | #include <KLocalizedString> | ||
42 | #include <QCryptographicHash> | 42 | #include <QCryptographicHash> | ||
43 | #include <QNetworkProxy> | ||||
43 | 44 | | |||
44 | #include <kio/slaveinterface.h> | 45 | #include <kio/slaveinterface.h> | ||
46 | #include <ktcpsocket.h> | ||||
45 | 47 | | |||
46 | #define GREETING_BUF_LEN 1024 | 48 | #define GREETING_BUF_LEN 1024 | ||
47 | #define MAX_RESPONSE_LEN 512 | 49 | #define MAX_RESPONSE_LEN 512 | ||
48 | #define MAX_COMMANDS 10 | 50 | #define MAX_COMMANDS 10 | ||
49 | 51 | | |||
50 | extern "C" { | 52 | extern "C" { | ||
51 | int Q_DECL_EXPORT kdemain(int argc, char **argv); | 53 | int Q_DECL_EXPORT kdemain(int argc, char **argv); | ||
52 | } | 54 | } | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
608 | { | 610 | { | ||
609 | qCDebug(POP3_LOG); | 611 | qCDebug(POP3_LOG); | ||
610 | char *greeting_buf; | 612 | char *greeting_buf; | ||
611 | if ((m_iOldPort == m_iPort) && (m_sOldServer == m_sServer) | 613 | if ((m_iOldPort == m_iPort) && (m_sOldServer == m_sServer) | ||
612 | && (m_sOldUser == m_sUser) && (m_sOldPass == m_sPass)) { | 614 | && (m_sOldUser == m_sUser) && (m_sOldPass == m_sPass)) { | ||
613 | qCDebug(POP3_LOG) << "Reusing old connection"; | 615 | qCDebug(POP3_LOG) << "Reusing old connection"; | ||
614 | return true; | 616 | return true; | ||
615 | } | 617 | } | ||
618 | | ||||
619 | if (!hasMetaData(QStringLiteral("useProxy")) | ||||
mlaurent: coding style if(...) { | |||||
620 | || metaData(QStringLiteral("useProxy")) != QLatin1String("on")) { | ||||
621 | qCDebug(POP3_LOG) << "requested to use no proxy"; | ||||
622 | | ||||
623 | KTcpSocket *sock = qobject_cast<KTcpSocket *>(socket()); | ||||
624 | if (sock) { | ||||
mlaurent: if (sock) { | |||||
625 | QNetworkProxy proxy; | ||||
626 | proxy.setType(QNetworkProxy::NoProxy); | ||||
627 | sock->setProxy(proxy); | ||||
628 | } else { | ||||
629 | qCWarning(POP3_LOG) << "no socket, cannot set no proxy"; | ||||
630 | } | ||||
mlaurent: } else {
...
} | |||||
631 | } | ||||
632 | | ||||
616 | do { | 633 | do { | ||
617 | closeConnection(); | 634 | closeConnection(); | ||
618 | 635 | | |||
619 | if (!connectToHost((isAutoSsl() ? QStringLiteral("pop3s") : QStringLiteral("pop3")), m_sServer, m_iPort)) { | 636 | if (!connectToHost((isAutoSsl() ? QStringLiteral("pop3s") : QStringLiteral("pop3")), m_sServer, m_iPort)) { | ||
620 | // error(ERR_COULD_NOT_CONNECT, m_sServer); | 637 | // error(ERR_COULD_NOT_CONNECT, m_sServer); | ||
621 | // ConnectToHost has already send an error message. | 638 | // ConnectToHost has already send an error message. | ||
622 | return false; | 639 | return false; | ||
623 | } | 640 | } | ||
Show All 24 Lines |
coding style if(...) {