diff options
Diffstat (limited to 'src/declarative/qml/qdeclarativexmlhttprequest.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index ff3b13b..8c97e29 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -58,6 +58,8 @@ #include <QtCore/qstack.h> #include <QtCore/qdebug.h> +#ifndef QT_NO_XMLSTREAMREADER + // From DOM-Level-3-Core spec // http://www.w3.org/TR/DOM-Level-3-Core/core.html #define INDEX_SIZE_ERR 1 @@ -1304,10 +1306,11 @@ QString QDeclarativeXMLHttpRequest::responseBody() const { QXmlStreamReader reader(m_responseEntityBody); reader.readNext(); +#ifndef QT_NO_TEXTCODEC QTextCodec *codec = QTextCodec::codecForName(reader.documentEncoding().toString().toUtf8()); if (codec) return codec->toUnicode(m_responseEntityBody); - +#endif return QString::fromUtf8(m_responseEntityBody); } @@ -1662,4 +1665,6 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine) QT_END_NAMESPACE +#endif // QT_NO_XMLSTREAMREADER + #include <qdeclarativexmlhttprequest.moc> |