From 781a9cf3d77f2a594e779186d3293c63385f1e4b Mon Sep 17 00:00:00 2001 From: "Richard J. Moore" Date: Sat, 8 Feb 2014 15:37:56 +0000 Subject: Ensure the webftp example works with newer versions of webkit. The code currently has a bug that it will return the incorrect number for bytesAvailable() since it doesn't take account of the QIODevice buffer. This fails when peek() is called (which is used by newer webkits). See QTBUG-27469 for an example of the problem. Note this example does not exist in qt5 so this is not a backport. Change-Id: Ic61248d0f36db6a6a65d0c48a8f40346dc7c3cb6 Reviewed-by: Allan Sandfeld Jensen --- examples/webkit/webftpclient/ftpreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webkit/webftpclient/ftpreply.cpp b/examples/webkit/webftpclient/ftpreply.cpp index 8bdf8b9ad4..1ddcc28eaa 100644 --- a/examples/webkit/webftpclient/ftpreply.cpp +++ b/examples/webkit/webftpclient/ftpreply.cpp @@ -212,7 +212,7 @@ void FtpReply::abort() //! [bytes available] qint64 FtpReply::bytesAvailable() const { - return content.size() - offset; + return content.size() - offset + QIODevice::bytesAvailable(); } //! [bytes available] -- cgit v1.2.1