summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.h
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2014-02-04 12:29:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-05 20:13:35 +0100
commit0a9ea1ed6f2c201445381be62305a5e8b889f321 (patch)
tree277995f66a26f2435875e06d8d3d0949f3616acb /src/websockets/qwebsocket_p.h
parent8f41c45d2835d70a29fd64b50194bf617556f46d (diff)
downloadqtwebsockets-0a9ea1ed6f2c201445381be62305a5e8b889f321.tar.gz
Use QObjectPrivate instead of dedicated d-ptr
Change-Id: I3f69a2b0ca81e1e003200bb8e0a337b9532e64a0 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsocket_p.h')
-rw-r--r--src/websockets/qwebsocket_p.h34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h
index d8c97dd..3bd9918 100644
--- a/src/websockets/qwebsocket_p.h
+++ b/src/websockets/qwebsocket_p.h
@@ -64,6 +64,7 @@
#include <QtNetwork/QSslSocket>
#endif
#include <QtCore/QTime>
+#include <private/qobject_p.h>
#include "qwebsocketprotocol.h"
#include "qwebsocketdataprocessor_p.h"
@@ -94,17 +95,15 @@ public:
QTcpSocket *m_pSocket;
};
-class QWebSocketPrivate : public QObject
+class QWebSocketPrivate : public QObjectPrivate
{
- Q_OBJECT
Q_DISABLE_COPY(QWebSocketPrivate)
- Q_DECLARE_PUBLIC(QWebSocket)
public:
+ Q_DECLARE_PUBLIC(QWebSocket)
explicit QWebSocketPrivate(const QString &origin,
QWebSocketProtocol::Version version,
- QWebSocket * const pWebSocket,
- QObject *parent = Q_NULLPTR);
+ QWebSocket * const pWebSocket);
virtual ~QWebSocketPrivate();
void init();
@@ -143,32 +142,20 @@ public:
#ifndef QT_NO_SSL
void ignoreSslErrors(const QList<QSslError> &errors);
+ void ignoreSslErrors();
void setSslConfiguration(const QSslConfiguration &sslConfiguration);
QSslConfiguration sslConfiguration() const;
#endif
-public Q_SLOTS:
void close(QWebSocketProtocol::CloseCode closeCode, QString reason);
void open(const QUrl &url, bool mask);
void ping(const QByteArray &payload);
-#ifndef QT_NO_SSL
- void ignoreSslErrors();
-#endif
-
-private Q_SLOTS:
- void processData();
- void processPing(const QByteArray &data);
- void processPong(const QByteArray &data);
- void processClose(QWebSocketProtocol::CloseCode closeCode, QString closeReason);
- void processHandshake(QTcpSocket *pSocket);
- void processStateChanged(QAbstractSocket::SocketState socketState);
-
-private:
QWebSocket * const q_ptr;
+private:
QWebSocketPrivate(QTcpSocket *pTcpSocket, QWebSocketProtocol::Version version,
- QWebSocket *pWebSocket, QObject *parent = Q_NULLPTR);
+ QWebSocket *pWebSocket);
void setVersion(QWebSocketProtocol::Version version);
void setResourceName(const QString &resourceName);
void setRequestUrl(const QUrl &requestUrl);
@@ -179,6 +166,13 @@ private:
void setSocketState(QAbstractSocket::SocketState state);
void setErrorString(const QString &errorString);
+ void processData();
+ void processPing(const QByteArray &data);
+ void processPong(const QByteArray &data);
+ void processClose(QWebSocketProtocol::CloseCode closeCode, QString closeReason);
+ void processHandshake(QTcpSocket *pSocket);
+ void processStateChanged(QAbstractSocket::SocketState socketState);
+
qint64 doWriteFrames(const QByteArray &data, bool isBinary) Q_REQUIRED_RESULT;
void makeConnections(const QTcpSocket *pTcpSocket);