summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/doc/src/qtxml-index.qdoc11
-rw-r--r--src/xml/sax/qxml.cpp14
2 files changed, 12 insertions, 13 deletions
diff --git a/src/xml/doc/src/qtxml-index.qdoc b/src/xml/doc/src/qtxml-index.qdoc
index eb35903756..91f2515d60 100644
--- a/src/xml/doc/src/qtxml-index.qdoc
+++ b/src/xml/doc/src/qtxml-index.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -45,4 +45,13 @@
The \l{Qt XML C++ Classes} page gives an overview over the available classes
in this module.
+
+ \section1 Licenses
+
+ The Qt XML module is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under free software licenses. Since Qt 5.4,
+ these free software licenses are
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt Licensing} for further details.
*/
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index b781176e13..168e8c3cb4 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -1270,18 +1270,8 @@ void QXmlInputSource::fetchData()
} else if (device->isOpen() || device->open(QIODevice::ReadOnly)) {
rawData.resize(BufferSize);
qint64 size = device->read(rawData.data(), BufferSize);
-
- if (size != -1) {
- // We don't want to give fromRawData() less than four bytes if we can avoid it.
- while (size < 4) {
- if (!device->waitForReadyRead(-1))
- break;
- int ret = device->read(rawData.data() + size, BufferSize - size);
- if (ret <= 0)
- break;
- size += ret;
- }
- }
+ if (size == 0 && device->waitForReadyRead(-1))
+ size = device->read(rawData.data(), BufferSize);
rawData.resize(qMax(qint64(0), size));
}