diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2013-08-26 15:06:28 +0200 |
---|---|---|
committer | Kurt Pattyn <pattyn.kurt@gmail.com> | 2013-08-26 15:06:28 +0200 |
commit | f23d933f8b4e848b6fb4b2c5aee239700968844f (patch) | |
tree | 5037c701010f44ad6e71713b6726eb58c71f0034 | |
parent | ce50e40cfa9ad9a7da9d9b558a93116472d98cdf (diff) | |
download | qtwebsockets-f23d933f8b4e848b6fb4b2c5aee239700968844f.tar.gz |
Made parameters const references
-rw-r--r-- | src/qwebsocket.cpp | 5 | ||||
-rw-r--r-- | src/qwebsocket.h | 2 | ||||
-rw-r--r-- | src/qwebsocket_p.cpp | 12 | ||||
-rw-r--r-- | src/qwebsocket_p.h | 12 |
4 files changed, 16 insertions, 15 deletions
diff --git a/src/qwebsocket.cpp b/src/qwebsocket.cpp index b42984c..0fc286a 100644 --- a/src/qwebsocket.cpp +++ b/src/qwebsocket.cpp @@ -289,9 +289,10 @@ qint64 QWebSocket::write(const QByteArray &data) The \a closeCode is a QWebSocketProtocol::CloseCode indicating the reason to close, and \a reason describes the reason of the closure more in detail */ -void QWebSocket::close(QWebSocketProtocol::CloseCode closeCode, QString reason) +void QWebSocket::close(QWebSocketProtocol::CloseCode closeCode, const QString &reason) { - d_ptr->close(closeCode, reason); + Q_D(QWebSocket); + d->close(closeCode, reason); } /*! diff --git a/src/qwebsocket.h b/src/qwebsocket.h index 94471fb..e1791af 100644 --- a/src/qwebsocket.h +++ b/src/qwebsocket.h @@ -84,7 +84,7 @@ public: qint64 write(const QByteArray &data); //send data as binary public Q_SLOTS: - void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CC_NORMAL, QString reason = QString()); + void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CC_NORMAL, const QString &reason = QString()); void open(const QUrl &url, bool mask = true); void ping(); diff --git a/src/qwebsocket_p.cpp b/src/qwebsocket_p.cpp index aea3fb4..c39af5c 100644 --- a/src/qwebsocket_p.cpp +++ b/src/qwebsocket_p.cpp @@ -281,7 +281,7 @@ void QWebSocketPrivate::setVersion(QWebSocketProtocol::Version version) \internal Sets the resource name of the connection; must be set before the socket is openend */ -void QWebSocketPrivate::setResourceName(QString resourceName) +void QWebSocketPrivate::setResourceName(const QString &resourceName) { m_resourceName = resourceName; } @@ -289,7 +289,7 @@ void QWebSocketPrivate::setResourceName(QString resourceName) /*! \internal */ -void QWebSocketPrivate::setRequestUrl(QUrl requestUrl) +void QWebSocketPrivate::setRequestUrl(const QUrl &requestUrl) { m_requestUrl = requestUrl; } @@ -297,7 +297,7 @@ void QWebSocketPrivate::setRequestUrl(QUrl requestUrl) /*! \internal */ -void QWebSocketPrivate::setOrigin(QString origin) +void QWebSocketPrivate::setOrigin(const QString &origin) { m_origin = origin; } @@ -305,7 +305,7 @@ void QWebSocketPrivate::setOrigin(QString origin) /*! \internal */ -void QWebSocketPrivate::setProtocol(QString protocol) +void QWebSocketPrivate::setProtocol(const QString &protocol) { m_protocol = protocol; } @@ -313,7 +313,7 @@ void QWebSocketPrivate::setProtocol(QString protocol) /*! \internal */ -void QWebSocketPrivate::setExtension(QString extension) +void QWebSocketPrivate::setExtension(const QString &extension) { m_extension = extension; } @@ -1021,7 +1021,7 @@ void QWebSocketPrivate::setSocketState(QAbstractSocket::SocketState state) /*! \internal */ -void QWebSocketPrivate::setErrorString(QString errorString) +void QWebSocketPrivate::setErrorString(const QString &errorString) { m_errorString = errorString; } diff --git a/src/qwebsocket_p.h b/src/qwebsocket_p.h index d2f49ca..02228c6 100644 --- a/src/qwebsocket_p.h +++ b/src/qwebsocket_p.h @@ -116,14 +116,14 @@ private: QWebSocketPrivate(QTcpSocket *pTcpSocket, QWebSocketProtocol::Version version, QWebSocket *pWebSocket, QObject *parent = 0); void setVersion(QWebSocketProtocol::Version version); - void setResourceName(QString resourceName); - void setRequestUrl(QUrl requestUrl); - void setOrigin(QString origin); - void setProtocol(QString protocol); - void setExtension(QString extension); + void setResourceName(const QString &resourceName); + void setRequestUrl(const QUrl &requestUrl); + void setOrigin(const QString &origin); + void setProtocol(const QString &protocol); + void setExtension(const QString &extension); void enableMasking(bool enable); void setSocketState(QAbstractSocket::SocketState state); - void setErrorString(QString errorString); + void setErrorString(const QString &errorString); qint64 doWriteData(const QByteArray &data, bool isBinary); qint64 doWriteFrames(const QByteArray &data, bool isBinary); |