summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard J. Moore <rich@kde.org>2014-02-08 15:37:56 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-08 21:40:58 +0100
commit781a9cf3d77f2a594e779186d3293c63385f1e4b (patch)
treee5f084fa813d008ef22f25b0bada90b8f2b6dfa4
parenta5878c18c3e41105fbb64e09c6ccbac166a6f08f (diff)
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 <allan.jensen@digia.com>
-rw-r--r--examples/webkit/webftpclient/ftpreply.cpp2
1 files changed, 1 insertions, 1 deletions
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]