Browse Source

Code formatting

Remove extra private keyword
adaptive-webui-19844
Chocobo1 8 years ago committed by sledgehammer999
parent
commit
84bc011df5
No known key found for this signature in database
GPG Key ID: 6E4A2D025B7CC9A2
  1. 12
      src/base/http/server.cpp
  2. 20
      src/base/http/server.h

12
src/base/http/server.cpp

@ -86,15 +86,15 @@ void Server::incomingConnection(int socketDescriptor)
if (serverSocket->setSocketDescriptor(socketDescriptor)) { if (serverSocket->setSocketDescriptor(socketDescriptor)) {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_OPENSSL
if (m_https) { if (m_https) {
static_cast<QSslSocket*>(serverSocket)->setProtocol(QSsl::SecureProtocols); static_cast<QSslSocket *>(serverSocket)->setProtocol(QSsl::SecureProtocols);
static_cast<QSslSocket*>(serverSocket)->setPrivateKey(m_key); static_cast<QSslSocket *>(serverSocket)->setPrivateKey(m_key);
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
static_cast<QSslSocket*>(serverSocket)->setLocalCertificateChain(m_certificates); static_cast<QSslSocket *>(serverSocket)->setLocalCertificateChain(m_certificates);
#else #else
static_cast<QSslSocket*>(serverSocket)->setLocalCertificate(m_certificates.first()); static_cast<QSslSocket *>(serverSocket)->setLocalCertificate(m_certificates.first());
#endif #endif
static_cast<QSslSocket*>(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone); static_cast<QSslSocket *>(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone);
static_cast<QSslSocket*>(serverSocket)->startServerEncryption(); static_cast<QSslSocket *>(serverSocket)->startServerEncryption();
} }
#endif #endif
new Connection(serverSocket, m_requestHandler, this); new Connection(serverSocket, m_requestHandler, this);

20
src/base/http/server.h

@ -44,7 +44,7 @@ namespace Http
class IRequestHandler; class IRequestHandler;
class Connection; class Connection;
class Server : public QTcpServer class Server: public QTcpServer
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(Server) Q_DISABLE_COPY(Server)
@ -53,25 +53,25 @@ namespace Http
Server(IRequestHandler *requestHandler, QObject *parent = 0); Server(IRequestHandler *requestHandler, QObject *parent = 0);
~Server(); ~Server();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_OPENSSL
void enableHttps(const QList<QSslCertificate> &certificates, const QSslKey &key); void enableHttps(const QList<QSslCertificate> &certificates, const QSslKey &key);
void disableHttps(); void disableHttps();
#endif #endif
private: private:
#ifdef QBT_USES_QT5 IRequestHandler *m_requestHandler;
#ifdef QBT_USES_QT5
void incomingConnection(qintptr socketDescriptor); void incomingConnection(qintptr socketDescriptor);
#else #else
void incomingConnection(int socketDescriptor); void incomingConnection(int socketDescriptor);
#endif #endif
private: #ifndef QT_NO_OPENSSL
IRequestHandler *m_requestHandler;
#ifndef QT_NO_OPENSSL
bool m_https; bool m_https;
QList<QSslCertificate> m_certificates; QList<QSslCertificate> m_certificates;
QSslKey m_key; QSslKey m_key;
#endif #endif
}; };
} }

Loading…
Cancel
Save