Rename QAbstractSocket::PauseOnNotify -> PauseOnSslErrors
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Mon, 30 Apr 2012 18:14:06 +0000 (19:14 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 4 May 2012 01:11:17 +0000 (03:11 +0200)
Although we created an enum for pause modes to make 5.x binary
compatible with 5.0, the enum value is not well named.
In 5.1, we propose to add PauseOnProxyAuthentication to the enum.
PauseOnNotify is not clear what it means, while PauseOnSslErrors is.

Any new notification in a minor release would need a new enum value
otherwise applications would get pauses they did not expect.

Task-number: QTBUG-19032
Change-Id: I4dbb7467663b37ca7f0551d24a31bc013968bedc
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/network/socket/qabstractsocket.cpp
src/network/socket/qabstractsocket.h
src/network/ssl/qsslsocket.cpp
src/network/ssl/qsslsocket_openssl.cpp
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

index 0c4eed8..a6eb362 100644 (file)
 
     This enum describes the behavior of when the socket should hold
     back with continuing data transfer.
+    The only notification currently supported is QSslSocket::sslErrors().
 
     \value PauseNever Do not pause data transfer on the socket. This is the
     default and matches the behaviour of Qt 4.
-    \value PauseOnNotify Pause data transfer on the socket upon receiving a
-    notification. The only notification currently supported is
-    QSslSocket::sslErrors().
+    \value PauseOnSslErrors Pause data transfer on the socket upon receiving an
+    SSL error notification. I.E. QSslSocket::sslErrors().
 */
 
 #include "qabstractsocket.h"
@@ -1404,7 +1404,7 @@ QAbstractSocket::PauseModes QAbstractSocket::pauseMode() const
     \since 5.0
 
     Controls whether to pause upon receiving a notification. The only notification
-    currently supported is QSslSocket::sslErrors(). If set to PauseOnNotify,
+    currently supported is QSslSocket::sslErrors(). If set to PauseOnSslErrors,
     data transfer on the socket will be paused and needs to be enabled explicitly
     again by calling resume().
     By default this option is set to PauseNever.
index 7a9f70b..dedde96 100644 (file)
@@ -127,7 +127,7 @@ public:
     Q_DECLARE_FLAGS(BindMode, BindFlag)
     enum PauseMode {
         PauseNever = 0x0,
-        PauseOnNotify = 0x1
+        PauseOnSslErrors = 0x1
     };
     Q_DECLARE_FLAGS(PauseModes, PauseMode)
 
index cfc59fd..3445f13 100644 (file)
@@ -361,7 +361,7 @@ QSslSocket::~QSslSocket()
     \since 5.0
 
     Continues data transfer on the socket after it has been paused. If
-    "setPauseMode(QAbstractSocket::PauseOnNotify);" has been called on
+    "setPauseMode(QAbstractSocket::PauseOnSslErrors);" has been called on
     this socket and a sslErrors() signal is received, calling this method
     is necessary for the socket to continue.
 
index eddedac..d193449 100644 (file)
@@ -1299,7 +1299,7 @@ bool QSslSocketBackendPrivate::checkSslErrors()
     bool doEmitSslError = !verifyErrorsHaveBeenIgnored();
     // check whether we need to emit an SSL handshake error
     if (doVerifyPeer && doEmitSslError) {
-        if (q->pauseMode() & QAbstractSocket::PauseOnNotify) {
+        if (q->pauseMode() & QAbstractSocket::PauseOnSslErrors) {
             pauseSocketNotifiers(q);
             paused = true;
         } else {
index 34bc361..e134f34 100644 (file)
@@ -2158,7 +2158,7 @@ void tst_QSslSocket::resume()
     QFETCH(bool, expectSuccess);
 
     QSslSocket socket;
-    socket.setPauseMode(QAbstractSocket::PauseOnNotify);
+    socket.setPauseMode(QAbstractSocket::PauseOnSslErrors);
 
     QSignalSpy sslErrorSpy(&socket, SIGNAL(sslErrors(QList<QSslError>)));
     QSignalSpy encryptedSpy(&socket, SIGNAL(encrypted()));